Skip to content
MermaidViewer

Mermaid to PDF

Convert mermaid to PDF in the browser. Preview is free. The PDF download is included with Pro.

Download PDF with ProOpen in full editor

The live preview is free. PDF downloads are part of Pro; every plan can download PNG and copy the Mermaid code.

How to convert Mermaid to PDF

  1. Paste your Mermaid code above.
  2. Choose a theme and background.
  3. Download PDF is on Pro ($11.99/month or $119.90/year). The page is sized to the diagram with a small margin. PNG download stays available on every plan.

When to use PDF

PDF is perfect for specs, architecture reviews, printed handouts and attaching diagrams to formal documents. Because the export is vector-based, it prints crisply at any size and the text remains selectable.

Good to know

  • The PDF is generated locally in your browser using vector drawing — no screenshots.
  • Very wide diagrams produce a landscape page automatically.
  • To combine several diagrams in one document, export each and merge them, or paste PNGs into your doc tool.
  • Prefer an image? Try Mermaid to PNG or Mermaid to SVG.

Reach for mermaid to pdf when the diagram is a document, not a chat attachment. Paste the code, set a theme and a background, and preview a vector page sized to the diagram. The preview runs in your browser and the diagram is not uploaded. The PDF download is included with Pro ($11.99/month or $119.90/year). PNG download stays on every plan.

PDF is the format people already know how to file. A spec, a review packet, a handout, and an email to someone who will not open a repo all accept it. Because this export is vector, zoom and print do not turn the type into a blur the way a small PNG does. The text stays text. You can select a label in a PDF reader. That is the property to want in a review, where someone will copy a name out of a box instead of retyping it wrong.

When PDF beats PNG and SVG

PNG is easier to drop into a slide. SVG is easier to drop into a website or a design tool. PDF is easier to hand to a process that already says "attach a PDF." Architecture reviews, change packets, and printed workshops are that process. A PDF also behaves as a single page with a real page size, which an SVG does not. You are not hoping the wiki scales an image. You are giving someone a page.

Use the PNG converter if the destination is Slack or a deck. Use the SVG converter if the destination is Figma or an HTML page. Use this page if the destination is a reader, a printer, or a folder of formal attachments. The export guide puts the same choice in one place, including the command-line option when you outgrow a browser tab.

Wide diagrams become wide pages on their own. You do not pick A4 and then watch the picture fall off the edge. A very tall flowchart becomes a tall page. That is helpful, and it can surprise someone who expected a letter-size sheet. If the PDF is awkward to print, the diagram is probably trying to say too much. Split it, then export two PDFs. Merging those into one packet is a normal PDF tool's job. This converter makes one diagram into one PDF.

The same Pro gate as the editor

PDF download is Pro in the editor and on this page. Free PNG is 1× with a small watermark. Starter ($6.99 a month or $69.90 a year) unlocks PNG up to 4× with no watermark. Pro ($11.99 a month or $119.90 a year) adds PDF, SVG, and JPG, and PNG or JPG up to 8×. The preview here is free. The download is not. Read pricing for the current list.

A concrete export

This sequence is a reasonable one-page handout. Export it, open the PDF, and select the word "Charge." If you can select it, you have a vector file, not a screenshot wrapped in a PDF.

Mermaid diagram
mermaid
sequenceDiagram
  participant Buyer
  participant Shop
  participant Bank
  Buyer->>Shop: Place order
  Shop->>Bank: Charge
  Bank-->>Shop: Approved
  Shop-->>Buyer: Receipt
Open in the live editor

Print it once before you send a packet to a room. Screen preview hides low contrast. The neutral theme is the calm choice for black-and-white printing. A dark theme will spend a lot of ink and may still look like a screenshot of an editor. Set the background to white unless you have a reason not to. Transparent backgrounds and paper do not always meet politely. Paper is white. Give it white.

What the file will not do

One diagram, one PDF. It will not assemble a ten-page design doc with headings and paragraphs between pictures. For that, export each diagram and merge, or paste PNGs into the doc tool your team already uses. Fighting this page into a report editor is slower than using a report editor.

The PDF is a snapshot. It will not update when you edit the Mermaid later. The source has to live somewhere else: a repo, a note, or a saved diagram. Put the date in the doc you attach it to if the picture is easy to confuse with next month's version. A pretty PDF becomes "the" architecture after one meeting, even when the text in Git has moved on. Write the date. Link the source.

Fonts can still substitute in a strict reader, though the vector paths for the shapes will not. If a label looks one pixel different on a colleague's machine, that is font substitution, not a failed export. If the whole page is blank, the diagram did not render. Fix the syntax in the preview before you download. The exporter does not have a second parser that repairs silent failures.

Very large graphs produce very large pages. A plotter might love that. A laptop PDF viewer will make you zoom and pan, which means the diagram is no longer a page. Split by subsystem. The same advice applies to every format, and it is more obvious in PDF because the page size makes the excess visible.

Privacy and the habit to keep

Rendering happens locally. Closing the tab drops the snippet unless you saved it somewhere on purpose. That is what you want for a diagram you pasted from a private repo just to make a handout. It is also how people lose work. Download the PDF, and copy the Mermaid back into the file it came from if you changed anything in the box.

If the diagram already lives in a README, preview the whole note in the Markdown viewer, then copy one fence here to make the PDF. You get context and a file, without uploading the note for the convert action. Keep the fence as the thing you edit. Keep the PDF as the thing you attach.

Frequently asked questions

Is the PDF vector or raster?

Vector. Shapes and text are drawn as PDF paths and text, so they stay sharp at any zoom level.

What page size is used?

The page is sized to fit the diagram plus a small margin, in portrait or landscape automatically.

Do I need an account?

The preview runs in your browser with no account. Downloading the PDF requires Pro ($11.99/month or $119.90/year). Copying the Mermaid code does not.

More converters