Convert Markdown to PDF

Turn Markdown with headings, lists, tables and code into a paginated A4 or Letter PDF, and check each page first.

How it works

  1. Type, paste or open your Markdown
  2. Check the page preview and choose paper, margins and text size
  3. Download the PDF

How the Markdown is turned into pages

This tool converts Markdown to a PDF by reading it with a GitHub-style Markdown parser and laying out headings, paragraphs, lists, task lists, tables, code blocks, quotes and rules on A4 or Letter pages. Text is set in the standard PDF fonts: Helvetica for text and Courier for code, so the file stays small and opens everywhere. The body text is 11 points by default, with lines 1.4 times as tall, so each line is 15.4 points high. An A4 page is 841.89 points tall; with normal margins of 54 points that leaves 733.89 points, which holds 47 lines. Headings are scaled from the body size: level 1 is 2 times, level 2 is 1.6, level 3 is 1.35, level 4 is 1.15, level 5 the same as the body and level 6 0.9. Levels 1 and 2 get a rule under them. A heading is never left alone at the bottom of a page, a code block or a list can continue on the next page, and a table repeats its header row when it breaks.

What is supported and what is not

Supported: bold, italic, bold italic, strikethrough, inline code, links, nested bullet and numbered lists, task lists, pipe tables with left, centre or right alignment, fenced code, block quotes and horizontal rules. Links starting with http, https or mailto are clickable in the PDF; other links print as plain text. Images are not fetched. Each one is printed as its description in square brackets, so a picture of a cat becomes [image: a cat]. Raw HTML is left out and the result counts how many pieces were skipped. Footnotes, math and diagrams are not interpreted. A PDF made this way has no table of contents, bookmarks or syntax colours. Long code lines are wrapped by characters, not scrolled, and a word wider than the line is broken across lines. Tables fit the page width, and a very long cell wraps inside its column. The PDF stops at 300 pages, and the Markdown can be up to 300,000 characters or a 2 MB file.

Characters the PDF fonts cannot print

The standard PDF fonts print Latin letters with accents, digits, common punctuation, curly quotes, the euro sign and a few symbols. They cannot print Cyrillic, Greek, Arabic, Hebrew, Chinese, Japanese, Korean or emoji. Those characters are printed as a question mark, and a sentence under the result tells you how many were replaced. A few have a close ASCII spelling and use it: an arrow becomes ->, a minus sign becomes a hyphen, and greater-or-equal becomes >=. If your document is mostly in another script, this tool is the wrong fit. The preview on screen uses your device's own fonts, so it may show shapes that the PDF will print as a question mark, and it is always the line breaks and page breaks that match the file.

Your Markdown stays in this tab

The Markdown is parsed, laid out and turned into a PDF by code running in your browser. There is no upload step and no server that receives your text. The page counts visits with Google Analytics, using rough groups of size, never your text or a file name. The text is kept in memory while the page is open. It is saved on this device only if you turn on Keep my draft on this device, which is off by default. Your paper, margin and text size choices are remembered in this browser. If you open a file, it is read as UTF-8 text on this device and must be under 2 MB.

Frequently asked questions

How do I convert Markdown to PDF?

Paste your Markdown into the box or open a .md file, check the page preview, choose A4 or Letter and the margins, and press Download PDF. The PDF is named after the first heading, such as weekend-trip-plan.pdf.

Does it handle tables, code blocks and task lists?

Yes. Pipe tables are drawn with a shaded header row and the alignment you set with colons, such as |:--|--:|. Fenced code goes in a grey box in Courier. Task lists print [x] and [ ] before each item. A table that runs past the page continues on the next page with its header repeated.

Why do some characters show as question marks?

The PDF uses the standard Helvetica and Courier fonts, which print Latin letters only. Cyrillic, Greek, Arabic, Chinese, Japanese, Korean and emoji become a question mark each, and the result says how many, for example 4 characters. Accents such as é and ü are fine. Use a word processor for text in other scripts.

Are images included in the PDF?

No. Images are not downloaded, so each one is printed as its description in square brackets, such as [image: a cat], and it links to the image address when that starts with http or https. Add the pictures in a word processor if you need them in the page.

How do I change the page size, margins or text size?

Choose A4 (210 by 297 mm) or Letter (8.5 by 11 in). Margins are narrow at 0.5 in, normal at 0.75 in or wide at 1 in. Text size runs from 8 to 20 points and defaults to 11. Headings and code scale from it, and the preview updates as you change them.

Is my Markdown uploaded?

No. The text is converted to a PDF by code running in your browser, and nothing is uploaded. The page counts visits with Google Analytics using rough groups of size, never your text. Your text is saved on this device only if you turn on Keep my draft, which is off by default.