How to use the Markdown to PDF Converter
- Type or paste Markdown into the editor, or click Open .md file to load a README or notes file from your device.
- Choose the page size (A4 or Letter), margins, font and text size. The preview shows the page as it will print.
- 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.
- 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
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
| Feature | Syntax | In the PDF |
|---|---|---|
| Headings | # H1 to ###### H6 | Sized 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, - [ ] todo | Ticked and empty checkboxes |
| Code blocks | Fenced with three backticks | Monospace on a grey panel; long lines wrap rather than get cut off |
| Strikethrough | ~~text~~ | Struck-through grey text |
| Links and images | [text](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?
Will the text in my PDF be selectable and searchable?
Does it support GitHub-flavoured Markdown tables and task lists?
How do I remove the date and URL from the top and bottom of the PDF?
Can I choose A4 or US Letter paper and set margins?
Is my document uploaded to a server?
Why are code blocks not colour-highlighted?
Last reviewed November 2026. Results are estimates for information only — see our disclaimer.