How to Convert Markdown to PDF
Paste or type your Markdown
Enter your Markdown in the editor or click Load Sample to see a template. The PDF preview on the right updates live as you type, parsing headings, bold and italic, lists, tables, fenced code blocks, blockquotes, links, and horizontal rules. The first H1 in your text becomes the document title.
Set page, spacing, font, and extras
Pick A4 or Letter as the page size and choose a spacing preset (Dense, Compact, Standard, or Airy) that adjusts margins, font size, and line height together. Select a font (Georgia, Arial, Courier New, or Times New Roman), then toggle the auto Table of Contents and the header and footer on or off.
Export to PDF
Click Export to PDF. The styled preview is rendered and saved as a PDF file when supported, named after your document title. For sensitive Markdown, confirm the active workflow before processing.
Spacing Presets Compared
The spacing control changes three settings at once so the whole document scales cleanly. Use a denser preset to fit more on each page, or an airier one for readability and review copies. The values below are applied at export time.
| Preset | Page margin | Font size | Line height | Best for |
|---|---|---|---|---|
| Dense | 10 mm | 11 px | 1.4 | Reference sheets and long docs where page count matters |
| Compact | 15 mm | 13 px | 1.55 | Technical notes and changelogs |
| Standard | 20 mm | 14 px | 1.7 | General documents and README exports (default) |
| Airy | 28 mm | 15 px | 1.9 | Drafts for printing, markup, and easy reading |
| Page size | A4 or Letter | set above | set above | Choose A4 (210 x 297 mm) or Letter (215.9 x 279.4 mm) |
Which Options Should You Use
Table of Contents
Turn this on for longer documents. It scans your H1, H2, and H3 headings and builds a Contents list automatically, with H2 and H3 entries indented. It only appears when the document has at least two headings, so short notes stay clean.
Header and footer
Enable to add a running header showing your document title and the page size, plus a footer with the export date. This suits reports and shared docs. Leave it off for minimal, body-only output.
Font choice
Use Georgia or Times New Roman for prose and reports, Arial for a clean modern look, and Courier New for code-heavy or documentation pages where a monospace body reads best.
README and docs export
Paste a README.md or API docs and keep Standard spacing. Tables, fenced code blocks, and blockquotes are styled with borders and light backgrounds, making it easy to share with people who do not use GitHub.
Common Problems and Fixes
The Table of Contents does not show
The Contents block only generates when your Markdown has two or more headings (H1, H2, or H3). Add headings using # and ## lines, and confirm the Contents toggle is set to On before exporting.
Links are not clickable in the PDF
The PDF is produced by rasterizing the styled preview, so links appear as colored text rather than active hyperlinks. Keep important URLs visible in the body text so readers can copy them, since they will not be clickable in the exported file.
A code block or table is split across pages
The exporter tries to keep code blocks, blockquotes, and tables on a single page. If an element is taller than one page it must still break. Switch to a denser spacing preset or shorten very long code blocks so each fits within the page height.
Export does nothing or shows a library error
Export needs the in-page conversion library to finish loading and needs non-empty Markdown. Wait a moment after the page loads, make sure the editor is not blank, then click Export to PDF again. A hard refresh resolves a blocked or partial script load.