Skip to content

Markdown to PDF converter

Markdown to PDF uses a document engine chain rather than LaTeX, producing a fixed PDF from semantic Markdown.

  • Converted with Document engine → PDF renderer · input deleted within 24 h
  • Free: 5 conversions a day · 5 MB each
  • Higher limits →

From real runs

What you get — and what changes

  • Headings Kept

    Markdown headings become PDF section headings and can feed the table of contents.

  • Paragraphs and lists Kept

    Normal paragraphs, bullets, and numbered lists render as fixed PDF text.

  • Code blocks Kept

    Fenced code blocks render with code highlighting supported by the document engine path.

  • Math Kept

    KaTeX-style inline and display math is converted through our PDF renderer, not LaTeX.

  • Mermaid diagrams Lost

    Mermaid fences are not rendered; convert diagrams to images first if they must appear.

  • Raw HTML and CSS Changed

    Our document engine may interpret simple inline HTML, but browser CSS is not applied to the PDF.

  • Page geometry Changed

    Page size, margins, and TOC are controlled by conversion options rather than by Markdown itself.

Sample conversions

Architecture note

Input
3,800-word Markdown architecture note with H2/H3 headings, shell code blocks, one Mermaid diagram, and a requested TOC.
Output
The PDF had a generated TOC, clean headings, and highlighted code. The Mermaid block appeared as code text because this route does not render Mermaid.

Math-heavy handout

Input
6-page Markdown handout with inline variables, display equations, three tables, and A4 margins.
Output
Our PDF renderer rendered the math and tables into a readable A4 PDF. One long equation exceeded the text width and needed a manual line break.

Release notes

Input
Markdown release notes with nested lists, issue links, and screenshots hosted over HTTPS.
Output
Lists and links rendered correctly, and reachable screenshots appeared. A private screenshot URL was omitted because the converter could not fetch it.

A real Markdown → PDF run

We converted our Markdown sample (472 B) with Document engine → PDF renderer on 2026-09-11. It took 49 ms and produced a 21 KB PDF file, 45× larger than the input. The engine raised no warnings.

Input · sample.md · 472 B

3 headings, 1 table, 4 list items, 0 code blocks, 0 image references

Headings
3
Tables
1
List items
4
Code blocks
0
Images
0
Lines
13

Output · sample.pdf · 21 KB

PDF 1.7, 1 page, selectable text (LibertinusSerif-Bold-Identity-H, LibertinusSerif-Bold, LibertinusSerif-Regular-Identity-H, LibertinusSerif-Regular), 0 image objects

Version
1.7
Pages
1
Fonts
LibertinusSerif-Bold-Identity-H, LibertinusSerif-Bold, LibertinusSerif-Regular-Identity-H, LibertinusSerif-Regular
Images
0
Text layer
yes

Options and when to change them

pageSize
Set Letter or A4 when the PDF will be printed or submitted to a region-specific process.
margins
Use when the default PDF renderer margins are too wide for dense notes or too narrow for review markup.
toc
Use when Markdown headings should generate a table of contents in the PDF.

Do it yourself

pandoc + Typst

bash
pandoc in.md --pdf-engine=typst -o out.pdf

Install Typst locally; this is not the older pandoc LaTeX PDF route.

pandoc + Typst with TOC

bash
pandoc in.md --pdf-engine=typst --toc -V papersize=letter -o out.pdf

Variable names and template support can differ from LaTeX examples found online.

Markdown to PDF by API or MCP

The HTTP API and the MCP server run the exact engine this page uses (Document engine → PDF renderer); the response carries the same warnings the web converter shows. Check support first with GET /api/v1/pairs?from=md&to=pdf.

curl
curl -X POST https://filetypeconverters.com/api/v1/convert \
  -H "Authorization: Bearer $FTC_API_KEY" \
  -F "file=@input.md" -F "from=md" -F "to=pdf" \
  --output output.pdf
API reference

When this is the wrong conversion

  • If collaborators need to edit in Word, convert Markdown to DOCX instead.
  • If your Markdown depends on Mermaid, render diagrams to images before converting or use a documentation tool that renders Mermaid.
  • If the input is already HTML with complex CSS, a browser print workflow may preserve styles better than our document engine.

Markdown to PDF questions

Is LaTeX used for Markdown to PDF?

No. This route is our document engine, so LaTeX packages and templates are not part of the conversion.

Will Mermaid diagrams render?

No. Mermaid code blocks remain text unless you render them to images before conversion.

Does Markdown math work?

KaTeX-style inline and display math is supported through our PDF renderer, but very long equations may need manual wrapping.

Can I add a table of contents?

Yes. Use the toc option so our document engine builds the TOC from Markdown headings before our PDF renderer renders the PDF.