Markdown to PDF Converter

Write or open a Markdown file, see the page exactly as it will print, and save it as a PDF with real, searchable text.

Free, no sign-upRuns in your browserUpdated November 2026
Page size
Page preview

Print / Save as PDF gives selectable, searchable text: choose Save as PDF as the destination. Download PDF (image) saves pages as pictures in one click, so its text can't be selected.

How to use the Markdown to PDF Converter

  1. Type or paste Markdown into the editor, or click Open .md file to load a README or notes file from your device.
  2. Choose the page size (A4 or Letter), margins, font and text size. The preview shows the page as it will print.
  3. Click Print / Save as PDF and choose Save as PDF (or "Microsoft Print to PDF") as the printer to get a PDF with selectable text.
  4. Or click Download PDF (image) for a one-click file in which each page is saved as an image.

Convert Markdown to PDF without installing anything

Markdown is a pleasant format to write in and a poor one to send. Clients, teachers and managers expect a PDF, and a raw .md file shows up as plain text full of asterisks and pipes. The usual fixes are a command-line tool like Pandoc, which needs a LaTeX install for PDF output, or an editor extension. This converter does the job in a browser tab. It renders GitHub-flavoured Markdown, shows the exact page layout, and hands the page to your browser's built-in PDF engine. The document is never uploaded.

How it works

Markdown → marked (GFM parser) → HTML → DOMPurify sanitizer → print stylesheet (@page size + margins) → browser PDF engine

The Markdown is parsed by marked, a widely used open-source parser with GitHub-flavoured Markdown enabled. The HTML it produces is cleaned by DOMPurify, which removes scripts, event handlers, forms, iframes and inline styles, so a pasted document can't run code in the page. The clean HTML is shown inside a sandboxed preview frame styled like a sheet of paper.

Print / Save as PDF prints that frame using a print stylesheet. The CSS @page rule sets the paper size and margins, and Chrome, Edge, Safari and Firefox lay out the text as real PDF text. The result is selectable, searchable and copyable, links stay clickable in most viewers, and files are small because no page images are embedded.

Download PDF (image) uses html2pdf.js (html2canvas + jsPDF), loaded only when you click it. It renders each page to an image and packs the images into a PDF, which gives a one-click download on any device. The trade-off is that the text is part of a picture, so you can't select or search it, and files are larger. Use it when you only need something to look at, and use Print for anything people will search, copy from or read with a screen reader.

Supported Markdown

FeatureSyntaxIn the PDF
Headings# H1 to ###### H6Sized headings; H1 and H2 have an underline rule
Tables (GFM)| a | b | + | :-- | --: |Bordered table with alignment; rows don't split across pages
Task lists- [x] done, - [ ] todoTicked and empty checkboxes
Code blocksFenced with three backticksMonospace on a grey panel; long lines wrap rather than get cut off
Strikethrough~~text~~Struck-through grey text
Links and images[text](url), ![alt](url)Underlined links; images scaled to the page width
Blockquotes, lists, rules>, -, 1., ---Standard formatting

Code blocks are not syntax-highlighted. They print in one readable colour, which also suits black-and-white printers.

Page setup tips

  • A4 or Letter: A4 (210 × 297 mm) is standard in most of the world, and US Letter (8.5 × 11 in) in the United States and Canada. Pick the one your reader will print on.
  • Margins: Normal (20 mm) suits most documents. Use Wide (1 inch) for formal reports and Narrow for dense reference sheets or wide tables.
  • In the print dialog, set the destination to Save as PDF and keep the scale at 100% or Default. If headers and footers with the date and URL appear, untick Headers and footers under More settings.
  • Page breaks: tick Start each H1 on a new page to begin every chapter on a fresh sheet. Headings are kept with the text that follows, and table rows are never split.
  • Backgrounds: the stylesheet asks the browser to print code-block and table-header shading. If they come out white, enable Background graphics in the print dialog.
  • Wide tables: a table with many columns may not fit a portrait page. Reduce the text size, use narrow margins, or switch to landscape in the print dialog.

Privacy and safety

Parsing, sanitizing and PDF creation all happen on your device. Your text is not sent to ShelbyTools or anyone else. The only network requests are for the open-source libraries themselves and for any images your Markdown links to, which load from their own web addresses just as they would on GitHub. Because the output is sanitized, raw HTML in your Markdown is limited to safe formatting tags. Scripts and embedded frames are removed.

Starting from a spreadsheet? Build the table with the CSV to Markdown Table converter first. For plain text without Markdown formatting, try Text to PDF. To combine the result with other files, use Merge PDF.

Frequently asked questions

How do I convert a Markdown file to PDF?
Click Open .md file (or paste the text), check the preview, then click Print / Save as PDF and pick Save as PDF as the printer. The PDF keeps headings, tables, code blocks and task lists, with real selectable text.
Will the text in my PDF be selectable and searchable?
Yes, if you use Print / Save as PDF. The browser writes real text into the PDF. The Download PDF (image) option saves each page as an image, so its text cannot be selected or searched.
Does it support GitHub-flavoured Markdown tables and task lists?
Yes. GFM tables with left, center and right alignment, task-list checkboxes, strikethrough, fenced code blocks and autolinks are all supported through the marked parser with GFM enabled.
How do I remove the date and URL from the top and bottom of the PDF?
Those are browser headers and footers. In the print dialog, open More settings and untick Headers and footers (Chrome and Edge), or turn off "Print headers and footers" in Safari.
Can I choose A4 or US Letter paper and set margins?
Yes. Pick A4 or Letter and Narrow (0.5 in), Normal (20 mm) or Wide (1 in) margins. The settings go into the print stylesheet, so the browser uses them automatically.
Is my document uploaded to a server?
No. The Markdown is converted and printed entirely in your browser. Only images that your document links to are fetched from their own websites, as they would be in any Markdown viewer.
Why are code blocks not colour-highlighted?
The converter prints code in a single readable colour on a light grey panel, which works on black-and-white printers too. Long lines wrap instead of being cut off at the page edge.

Last reviewed November 2026. Results are estimates for information only — see our disclaimer.