Skip to main content
Converter

Markdown to PDF Converter

Paste Markdown or open a .md file: the preview shows the real pages. Theme, page size, margins, page numbers, a clickable table of contents, coloured code and tables.

Theme
Page
Markdown
·or drop .md files and pictures here
PreviewLinks and headings clickable in the PDF
  • Real pages. What you see is the PDF: A4 or Letter, margins, page numbers.
  • Clickable. Links, contents and bookmarks work in the PDF; its text can be selected and searched.
  • Private. The PDF is made in your browser: nothing is uploaded.

Several .md files? Drop them all: one PDF each (ZIP) or one PDF that joins them.

Learn more

From Markdown to a PDF that reads like a document

How to convert a Markdown file to PDF

Open the .md file with the Open button, drop it on the page, or paste its text in the editor. The preview on the right lays the document out on real pages as you type, with the size, margins and page numbers of the PDF, so there is no surprise when you open the file. Pick a theme, choose A4 or US Letter and the margins, turn the table of contents on or off, then press Download PDF. Several files at once give one PDF each in a ZIP, or one PDF that joins them in the order of the tabs, each starting on a new page.

What Markdown is supported

Everything GitHub reads: headings, paragraphs, bold, italic, strike-through, inline code, links and automatic links, bulleted and numbered lists nested to any depth, task lists with ticked boxes, quotes, horizontal rules, tables with left, centred or right-aligned columns, code blocks with the colours of their language, and pictures. Simple HTML found in README files (centred paragraphs, line breaks, bold, superscript) keeps its text. Mermaid diagrams and LaTeX formulas are not drawn yet: they are printed as code, word for word.

Pictures in the PDF

A picture written as ![description](chart.png) is found by its file name: drop chart.png on the page with the Markdown, or drop it while writing to insert it at the cursor. PNG and JPEG are embedded as they are; WebP, GIF, SVG and BMP are redrawn as PNG. Pictures written inside the text as data URLs work too. A picture on another website cannot be fetched by your browser from this page: the PDF shows a framed note with its description in its place, so nothing disappears without a trace.

Save a ChatGPT, Claude or Gemini answer as a PDF

Chat assistants write their answers in Markdown. Use the copy button under the answer (not a selection of the page), paste it in the editor and download: headings, lists, tables and code come out as they were in the chat, on clean pages you can send or print.

For a long conversation, paste each answer you want to keep one after the other, with a page break between them, and turn on the table of contents to find them again.

How to add a page break in Markdown

Markdown has no page break of its own. Put the cursor where the new page should start and press Page break: the editor inserts an HTML comment reading pagebreak on its own line. It stays invisible on GitHub and in other viewers, and starts a new page here. The spellings page-break, \newpage and \pagebreak used by other converters work too.

Without manual breaks, “Don't split code and tables” moves a code block, a table or a short paragraph that would be cut to the next page, and a heading is never left alone at the bottom of a page.

Table of contents, bookmarks and page numbers

With Table of contents on, the PDF lists the headings of levels 1 to 3 after the title, each with its page number; a click on an entry opens that page. Write [TOC] on its own line to place the contents elsewhere. When the document starts with a single main title, the contents leave it out.

Every heading also becomes a bookmark in the PDF reader's side panel, nested by level. Page numbers are written at the foot of each page as “3 / 12”, and “Header with the title” repeats the document's first heading at the top of every page but the first.

Four themes, two page sizes, three margins

GitHub looks like a README on GitHub: a clean sans-serif, headings underlined, grey code blocks. Article sets the text in a serif font with a centred title, for reports and essays. Plain is black on white with no colour, for forms and documents that will be printed in black and white. Modern uses a geometric heading font, indigo headings and dark code blocks.

Pages are A4 (210 × 297 mm) or US Letter (8.5 × 11 in), with narrow (12.7 mm), normal (20 mm) or wide (25.4 mm) margins. Your choices are remembered on this device when you are signed in.

Code blocks with syntax highlighting

Name the language after the three backticks (js, ts, python, bash, sql, json, yaml, html, css, go, rust, java, c#, php, ruby…) and the code gets its colours, in the PDF and in the preview. Long lines wrap inside the block instead of running off the page; spaces and indentation are kept exactly.

A block whose language is not named stays in one colour. Inline code gets a light background, like on GitHub.

Convert a GitHub README to PDF

Download README.md from the repository (the Raw button, then save) and open it here with the pictures of its folder. Relative links between files stay as text; links to headings of the same file (#installation) work in the PDF.

Badges and screenshots hosted on other sites cannot be fetched by your browser here: download the ones you need and drop them with the file.

Why not just print the page to PDF?

A browser's “Print to PDF” cuts code blocks and tables across pages, adds the address and the date in the margins, and gives no bookmarks. Here every line is placed on the page before the PDF is written: what you see in the preview is exactly what the file holds.

If you prefer the browser's printing, the HTML button saves the document as a web page with its theme and print rules (page size, margins, blocks kept whole).

How it works

Convert Markdown to PDF in 3 steps

  1. Paste or open your Markdown

    Type, paste an answer from ChatGPT or Claude, or open one or several .md files. Drop the pictures they use beside them.

  2. Set the pages

    Pick a theme, A4 or Letter, the margins, page numbers and a table of contents. Add page breaks where you want them.

  3. Download the PDF

    The file you get is the preview you saw, with real text, working links and bookmarks. One PDF, or a ZIP for several files.

Practical guides

Real text, working links

What the PDF keeps

The text stays text: it can be selected, searched and read aloud, and it prints sharply at any size. Links open their page, entries of the table of contents and links to a heading jump to it, and the PDF reader's bookmarks list every heading.

Code keeps its colours and its line breaks, tables their alignment, task lists their ticked boxes.

Good to know

Private

The document is set and the PDF written by your browser: the Markdown, the pictures and the PDF never leave your device.

Only the fonts are downloaded, the first time, from this site.

Nothing is uploaded
Frequently asked questions

Markdown to PDF: frequently asked questions

Pages, themes, links and files