Skip to content

Convert Markdown to PDF

Paste Markdown, choose A4 or US Letter and a body font size, and download a clean text PDF. It is built for notes, READMEs and reports made of headings, paragraphs, lists and code.

Runs in your browserFree, no sign-upLast reviewed

Settings

Fill in the settings to see your result here.

Your result appears here instantly — nothing is uploaded.

Quick answers

How do I convert a Markdown file to PDF?
Open the .md file in a text editor, copy everything, paste it into the Markdown box above and press Convert to PDF. You get a paginated PDF named document.pdf. There is no file upload field; the text you paste is processed inside your browser.
Does the PDF keep bold and italic text?
No. In paragraphs and headings the ** and * markers are removed and the words print in the regular weight. Inside list items and blockquotes the markers are not removed and appear literally, so delete them from those lines before converting.
Are Markdown tables converted?
No. A pipe table is not laid out as a grid; its rows are printed as one paragraph of text with the pipe characters still in it. For a document with tables, convert the Markdown to HTML and print that page to PDF from your browser.
What margins and fonts does the PDF use?
Margins are fixed at 56 points on every side, about 0.78 in or 19.8 mm. Body text and lists use Helvetica, headings Helvetica Bold, blockquotes Helvetica Oblique and code Courier. Only the page size and the body font size can be changed.
How many lines fit on a page?
At the default 11 point size a page of continuous body text holds 45 lines on A4 and 42 on US Letter. At 8 points it is 56 and 52 lines; at 16 points, 34 and 32. Headings, lists and code change the count.
Why do I get a 'WinAnsi cannot encode' error?
The PDF uses the standard built-in fonts, which only cover the Windows-1252 character set. Emoji, arrows, Chinese, Japanese, Korean, Cyrillic, Greek and letters such as the Polish z with dot stop the conversion. Accented Western European letters, curly quotes, dashes and the euro sign are fine.

What Markdown to PDF Converter does

Use this page to convert Markdown to PDF without installing Pandoc or a LaTeX toolchain. The text is parsed in your browser and drawn straight onto PDF pages: headings in bold Helvetica, body text at the size you choose, bullet and numbered lists, fenced code in Courier on a grey panel, blockquotes in grey italics and horizontal rules as a thin line. Pages break automatically and the text stays selectable and searchable. It is deliberately a text-first converter. Tables, images, clickable links and inline bold or italic styling are not rendered, and only Western European characters are supported; the reference table below shows what each piece of syntax turns into.

What each Markdown element becomes in the PDF

Every row was checked by converting it with this tool and reading the text back out of the PDF.

MarkdownResult in the PDF
# Title to ###### TitleBold Helvetica heading with extra space above and below; size depends on level (see the next table)
Plain paragraphHelvetica at the body size, wrapped to the page width, dark grey-black
**bold**, *italic*, ~~struck~~, `code` in a paragraphThe words only, in regular type: bold, italic, struck, code
Two lines without a blank line betweenJoined into one paragraph with a space. Two trailing spaces do not force a break either
- OneA bullet line: • One
3. Third then 4. Fourth3. Third and 4. Fourth; the starting number is kept
- [x] Done• Done. The checkbox is dropped
An indented sub-list under an itemNot printed. Only top-level items appear
- item with **bold** and [link](https://x.y)Printed literally, markers included: • item with **bold** and [link](https://x.y)
Fenced or indented code blockCourier, one point smaller than body text, on a light grey panel. Leading indentation is collapsed and the language name is ignored
> Quoted lineGrey italic text. Inline markers such as ** stay visible
---A thin grey line across the text width
[Guide](https://example.com)The word Guide. The address is dropped and nothing is clickable
A bare address such as https://example.comPrinted as plain text
![Alt logo](logo.png)The alt text only: Alt logo
| Name | Qty | table rowsOne paragraph containing the raw pipes and dashes
<div>Hi <b>there</b></div>The tags printed exactly as typed

Heading sizes at each body font size

Heading size in points is the larger of body size + 2 and 24 minus 2.5 per heading level.

Body font sizeH1H2H3H4H5H6
8 pt21.51916.51411.510
11 pt (default)21.51916.5141313
14 pt21.51916.5161616
16 pt21.51918181818

H1 and H2 never change. At larger body sizes the lower levels flatten out, so H3 to H6 look identical at 16 points.

Lines of body text per page, A4 and US Letter

Measured on the first page of a single long paragraph. Line spacing is the font size plus 5 points.

Body font sizeA4US Letter
8 pt56 lines52 lines
9 pt52 lines48 lines
10 pt48 lines45 lines
11 pt45 lines42 lines
12 pt42 lines40 lines
14 pt38 lines35 lines
16 pt34 lines32 lines

The text column is 483.28 points wide on A4 and 500 points wide on US Letter.

Worked conversions

The sample report

The default text: an H1, a paragraph, an H2, three bullets and a blockquote. A4, 11 pt

1 page, 1.3 KB

Files are this small because the standard fonts are referenced, not embedded.

200 one-line paragraphs

Line 1 to Line 200, each separated by a blank line. A4, 11 pt

7 pages, 32 paragraphs on the first page

The same text takes 5 pages at 8 pt and 9 pages at 16 pt. US Letter at 11 pt also gives 7 pages, with 30 on the first.

Soft line breaks

Line one (Enter) Line two

Line one Line two

Leave a blank line wherever you want a new line to start.

A 120-line code block as the whole document

One fenced block of 120 short lines. A4, 11 pt

4 pages, the first one blank

A code block is moved to a fresh page when it does not fit in the space left. One taller than a full page still moves first, then runs on, and its grey panel does not continue onto later pages.

Prepare your Markdown so it converts cleanly

  • Remove ** and * emphasis from list items and blockquotes, where the markers would print.
  • Flatten nested lists into top-level items, or the sub-items will be missing from the PDF.
  • Rewrite links as text followed by the address, for example Guide (https://example.com), because the target of [Guide](...) is discarded.
  • Replace emoji, arrows and other symbols outside Windows-1252 with plain words to avoid the encoding error.
  • Split code blocks longer than about 50 lines, and do not rely on indentation inside them: Python and YAML lose their leading spaces.
  • Break up very long unbroken strings such as long URLs. Text wraps only at spaces, so a single long word runs past the right margin.
  • Delete YAML front matter. The opening --- becomes a rule and the keys below it print as a heading.

When to use a different route

This converter draws text directly into the PDF, which is why the output is tiny, opens identically everywhere and has real selectable text. The trade-off is that it only understands the block structure of a document. If your file depends on tables, images, syntax-highlighted code, clickable links, maths or diagrams, a browser-print route serves you better: turn the Markdown into HTML with a Markdown to HTML converter, open the result as a page, and use Print, then Save as PDF. The browser's own layout engine then handles everything HTML can express.

For documents in languages outside Western Europe, the same applies, because the built-in PDF fonts used here have no glyphs for those scripts. Command-line tools such as Pandoc are the usual choice when you need repeatable builds, custom templates or a table of contents.

Using Markdown to PDF Converter

  1. 1

    Paste or type your text into Markdown, replacing the sample report.

  2. 2

    Choose a Page size: A4 (210 x 297 mm) or US Letter (8.5 x 11 in).

  3. 3

    Set Body font size between 8 and 16 points. The default is 11.

  4. 4

    Press Convert to PDF. The document is rebuilt only when you press the button, not as you type.

  5. 5

    Check the preview and the Pages figure, then download document.pdf.

Answers to common questions

Is my text sent to a server?
No. Parsing and PDF generation both run in your browser, so drafts, internal documentation and private notes stay on your device.
Is there a length limit?
No fixed limit. A new page is started whenever the next line would cross the bottom margin, so long documents simply produce more pages. Very large inputs take longer because every line is measured and placed individually.
Does the PDF have page numbers or a table of contents?
No. The pages carry only your content, with no header, footer, numbering, bookmarks or contents list. You can stamp numbers on afterwards with an add page numbers to PDF tool.
Can I change the margins, font or colours?
No. Margins are fixed at 56 points, the typefaces are Helvetica and Courier, and text is near-black. Page size and body font size are the only settings.
Is code syntax highlighted?
No. Code blocks are printed in a single dark grey colour on a light grey panel. The language tag after the opening fence is ignored, and long lines wrap at spaces to stay inside the panel.
Can I get a landscape page or a size other than A4 and Letter?
No. Both sizes are portrait: A4 at 595.28 x 841.89 points and US Letter at 612 x 792 points. Legal, A5 and landscape layouts are not offered.
Why did my blank lines not add extra space?
Markdown treats any run of blank lines as one paragraph break, and the converter spaces blocks itself. Extra empty lines in the source have no effect on the PDF.
Will the PDF look like GitHub's rendering of my README?
No. GitHub renders tables, images, badges, task-list checkboxes and styled inline text; this tool keeps only headings, paragraphs, top-level lists, code, quotes and rules in a plain print layout.

Looking for something else? Browse all pdf tools or see every tool.