Convert Markdown to PDF

Markdown to PDF reads a .md file in this browser tab, draws its CommonMark structure and tables onto pages with the standard PDF fonts, and reopens the result to compare the text before the download appears. It refuses raw HTML, images, Mermaid diagrams and characters outside those fonts, so a README with a logo or a document with maths takes the Pandoc or print-from-browser route instead.

Markdown to PDF

How to convert a Markdown file to PDF

  1. Choose the .md file

    Open Markdown to PDF and drop the file on the page, or pick it. It is read in this browser tab and never uploaded.

  2. Read what it found

    The tool parses the file as CommonMark plus tables. An image, raw HTML, a diagram block or a character the standard PDF fonts cannot draw stops the job with a message naming it.

  3. Convert and verify

    The pages are drawn, the PDF is reopened, every page is rendered and the expected text is compared in order. Safe links are counted.

  4. Download

    The file appears only after the check passes. Open it and read the headings, the lists and the tables against the source.

What the converter draws

Markdown to PDF takes a .md file and draws it as a PDF in this browser tab. It understands CommonMark, the standard that fixes what a heading, a list or a code block means, plus the table extension that most editors and GitHub also accept. Headings of every level, paragraphs, emphasis, ordered and unordered lists including nested ones, fenced and indented code blocks, blockquotes, horizontal rules, links and pipe tables all come out as what they are: a heading is drawn larger, a code block in a monospace face, a table with its columns.

Links are kept as links. A URL in the source becomes a clickable region in the PDF, and the check counts the safe ones. A link with a scheme the tool does not allow is refused rather than written. Text stays text. The check reopens the finished file and compares the selectable text with what the parser expected, in order, so a README to PDF conversion here proves that every word reached a page.

The fonts are the standard set every PDF reader carries, which is why the file is small and opens the same everywhere, and also why some characters cannot be drawn. Latin text with accents is fine. A character outside those fonts, a CJK heading, an emoji, some mathematical symbols, stops the job with a message naming the character, rather than leaving an empty box in the output.

What it refuses, and why

The converter is a text-to-page tool, and it says no to anything that would turn it into a browser.

The reason is the check. Every structure the tool draws is one it can read back and compare. An image or an HTML fragment has no text to compare, so the tool would have to trust that it drew the thing correctly, and this site does not ship a conversion it cannot verify.

Converting a README to PDF

A README is the most common md file to PDF request, and it is usually the hardest case, because a README is written for GitHub, which renders HTML, images, badges and relative links. Before you convert, copy the file and strip what the converter refuses: the badge line, the logo, any HTML. What is left, the headings, the install steps in code blocks, the option tables, the licence paragraph, is exactly what draws well. Relative links to other files in the repository stay as links but point nowhere outside the repository. Replace them with full URLs when the PDF is going to someone who does not have the checkout.

Notes, specifications, meeting minutes and any document written in a plain editor convert without that preparation. A Markdown file to PDF conversion of a few hundred lines runs in the tab, and the page is ready to download as soon as the comparison passes.

When Pandoc or the browser is the better route

Two needs send you elsewhere. The first is typography: a custom font, a two-column layout, page headers and footers, a title page. Pandoc with a LaTeX or HTML engine does all of that, and its --pdf-engine flag chooses which. It is a command-line install, and a document with LaTeX maths, which Markdown to PDF does not draw, is its natural case.

The second is images and HTML. Open the Markdown in an editor that previews it, VS Code, Obsidian or Typora, or push it to a repository and view it in the browser, then print to PDF from that preview. The print dialog on every platform writes a PDF, and the preview has already rendered the images and the HTML. The text stays selectable on that route too, and Convert HTML to PDF covers the settings that decide how a printed page comes out.

A third path suits a document that someone else edits afterwards: convert the Markdown to .docx with Pandoc, then to PDF from Word, following Convert Word to PDF.

The other direction

PDF to Markdown reads the selectable text of a PDF and writes a verified .md file, which is the route back when a PDF is the only copy of a document that started as text. It cannot recover what the PDF never held, so a Markdown file that went through Pandoc with a custom template comes back as text with structure, not as the original source.

The rest of the document guides are under PDF, Word and Excel help.

Questions people ask

Do I need Pandoc installed to turn a Markdown file into a PDF?
Not for a text document. Markdown to PDF runs in this browser tab with no install. Pandoc earns its install when the document needs a custom font, LaTeX maths, page headers or images.
Why does the converter stop on my README?
A README usually opens with a logo image and a row of badges, and the converter refuses images and raw HTML rather than drawing a gap. Remove those lines from a copy and convert that.
Are the headings in the PDF still headings?
They are drawn as headings, larger than the body text, and every word stays selectable in the PDF, so a reader can search for a heading and find it.
Can it draw a Mermaid diagram?
No. A Mermaid fence is code to this converter and is not turned into a picture. Render the diagram elsewhere, or print the preview from an editor that renders Mermaid.
Why is a character in my file refused?
The PDF uses the standard fonts bundled with every reader, and a character outside them cannot be drawn. The tool names the character and stops, instead of writing an empty box. Replace it, or take the print route from a preview.
Is the Markdown file uploaded to convert it?
No. The file is parsed, drawn, reopened and compared in this browser tab. No request leaves the page, which is also why remote images are never fetched.

Do it now

The tool runs in this browser. Your file never leaves the machine, and the result is checked before you download it.

Markdown to PDF

Where to go next