Mermaid to PDF converter

Paste Mermaid code and download a PDF. Vector mode keeps the text selectable and the lines sharp at any zoom; image mode matches the preview pixel for pixel. Free, no sign-up, and nothing is uploaded.

flowchart LR
    A[Write Mermaid] --> B[Preview it]
    B --> C{Looks right?}
    C -->|No| A
    C -->|Yes| D([Export the image])
Loading the tool…

How to do it

  1. Step 1

    Paste your code

    Paste your Mermaid code into the box above, or upload a .mmd file.

  2. Step 2

    Choose a mode

    Pick a theme, then choose Vector for selectable text or Image for an exact copy of the preview.

  3. Step 3

    Choose a page

    Fit to diagram, A4 or Letter, and portrait, landscape or automatic orientation.

  4. Step 4

    Download the PDF

    Click Download PDF.

Why PDF

A PDF is the format most people can open without thinking: in a browser, in a mail client, on a phone. It also keeps the diagram as vector shapes, so a reviewer can zoom into a dense architecture diagram without it going soft, and it prints at full quality.

How the vector PDF is made

Vector mode renders the diagram with plain SVG text labels rather than HTML labels, then draws those shapes and that text into the PDF. If something in the diagram cannot be drawn that way, the tool falls back to Image mode and tells you.

Fit to diagram or a paper size

Fit to diagram is the right choice when the PDF is going into another document, such as a LaTeX paper or a slide, because there is no white page around it. A4 and Letter are for printing and for sending a single page to someone.

What this does not do

  • Vector PDFs use the built-in PDF fonts, so non-Latin text and emoji may not display. Use Image mode for those.
  • Very wide diagrams are scaled down to fit an A4 or Letter page and can become hard to read. Use Fit to diagram, or switch the flowchart direction to top-down.
  • Font Awesome icons in labels only appear in Image mode.

Frequently asked questions

Is the PDF vector or an image?

Yes, in Vector mode. The diagram is drawn into the PDF as shapes and text, so it stays sharp when zoomed or printed and the text can be selected and searched. Image mode embeds a high-resolution picture instead, which looks exactly like the preview but has no selectable text.

What page size should I choose?

Choose Fit to diagram for a page exactly the size of the diagram plus a small margin, which is best for embedding in other documents. Choose A4 or Letter for printing; the diagram is centred and scaled down to fit, never up.

Why does some text look different in the PDF?

Vector PDFs use the standard PDF fonts, which cover Latin text. If your labels use other scripts, such as Chinese, Arabic or emoji, switch to Image mode so the text keeps its original glyphs.

Is my diagram uploaded anywhere?

No. The PDF is built in your browser, so the diagram never leaves your machine and no account is needed.

Can I put several diagrams in one PDF?

Export each diagram to its own PDF here, then combine them with any PDF tool. If you need a document with text and several diagrams, write it in Markdown and use the Markdown previewer, then print it to PDF from the browser.

More Mermaid tools

All tools