Convert Markdown to PDF with a live page preview
The Markdown to PDF converter turns Markdown — README files, notes, documentation, assignments, meeting minutes — into a clean, paginated PDF. Type or paste on the left and the preview on the right shows the result on a sheet of A4, Letter, Legal or A5 paper, styled with one of three print themes.
It understands GitHub Flavored Markdown, so tables, task lists, strikethrough, autolinks and fenced code blocks all work. Optional extras turn a plain file into a proper document: a table of contents built from your headings, syntax colouring for code in 36 languages, and page breaks exactly where you want them.
Conversion runs in your browser with the open-source marked library. Your text is never uploaded, and any raw HTML in the Markdown is displayed in a sandboxed frame with scripts removed.
How to convert Markdown to PDF
- Type or paste Markdown into the Markdown box, press Load .md file, or drop a file onto the box.
- Choose a Theme — Clean, GitHub-like or Academic serif — then the page size, margins and, if you need it, landscape.
- Keep Table of contents ticked to list your headings under the title, and Highlight code to colour code blocks that name their language.
- Check the preview. Put
<!-- pagebreak -->on its own line wherever a new page should start. - Press Print to PDF and choose “Save as PDF”, or Download PDF (image) to save the file directly.
Markdown to PDF features
Three print themes
Clean sans-serif for everyday documents, GitHub-like for READMEs and technical docs, and Academic serif with justified text, a centred title, numbered sections and ruled tables.
Automatic table of contents
Built from your H1–H3 headings and placed under the title. In the Academic theme the entries carry the same 1, 1.1, 2 numbers as the headings.
Code highlighting
Fenced blocks tagged with a language are coloured by highlight.js, and long lines wrap instead of running off the page.
Print-friendly breaks
Headings stay with the text that follows, table rows and images are never split, and pagebreak markers start a new page in both outputs.
Two ways to save
Print to PDF keeps text selectable and searchable; the image download needs no print dialog at all.
How your Markdown appears in the PDF
| You write | You get |
|---|---|
# Title | The document title — also used as the PDF file name |
## Section, ### Subsection | Headings, listed in the table of contents |
```python … ``` | A code block, coloured when highlighting is on |
| A | B | with a |---|---| row | A bordered table whose rows never split across pages |
- [x] Done | A task-list item with a ticked box |
<!-- pagebreak --> or \newpage | The start of a new page |
 | An image scaled to fit the page width |
Choosing a theme, margins and page size
- Clean — 11 pt sans-serif with light grey code blocks. A good default for notes, handouts and internal documents.
- GitHub-like — the familiar README look, with underlined section headings and striped tables.
- Academic serif — 11.5 pt Times-style justified text, with sections numbered automatically. Don’t type numbers into your headings, or you’ll see “1. 1. Introduction”.
- Margins — narrow (12.7 mm, 0.5 in) fits the most on a page, normal (20 mm) suits most documents, and wide (25.4 mm, 1 in) is the usual requirement for coursework. Use A4 in India, the UK and most of the world; US Letter in the US and Canada.
Print to PDF or image PDF?
Print to PDF opens your browser’s print dialog with the paper size and margins already set. Choose “Save as PDF” in Chrome or Edge, “Save to PDF” in Firefox, or the PDF menu in Safari, and untick headers and footers. The PDF contains real text that can be selected, searched and read aloud, and web links stay clickable.
Download PDF (image) needs no dialog: each page is captured as a picture at about 190 dpi and each cut is placed on a blank line, so text is never sliced. The text can’t be selected, so prefer printing for anything people will search or copy from.
Need page numbers? Add them afterwards with Add Page Numbers, and join several exports with Merge PDF. Want HTML instead? Use the Markdown to HTML converter.
Markdown to PDF FAQ
How do I convert a Markdown file to PDF?
Press “Load .md file” or paste your Markdown, pick a theme and page size, then press “Print to PDF” and choose “Save as PDF” — or press “Download PDF (image)”. It is free, with no sign-up or watermark.
Can I add a table of contents?
Yes. Keep “Table of contents” ticked and a list of your headings appears under the title, linked to each section. It needs at least two headings.
Which languages does code highlighting support?
The 36 common languages of highlight.js, including Python, JavaScript, TypeScript, Java, C, C++, C#, Go, Rust, PHP, Ruby, Kotlin, Swift, SQL, Bash, JSON, YAML, HTML/XML and CSS. Name the language after the opening fence, for example ```python.
How do I start a new page?
Put <!-- pagebreak -->, \newpage or \pagebreak on a line of its own. Markers inside code blocks are left alone.
Why don’t my images appear?
Relative paths such as images/chart.png point at files on your computer, which a web page can’t read. Use full https:// image addresses instead.
Is my Markdown uploaded?
No. The Markdown is converted and the PDF created in your browser, so private notes and documents never leave your device.