Mermaid Online

PDF export · docs and print handoff

Mermaid to PDF Converter

Paste Mermaid code, preview the rendered diagram, then export a clean high-resolution PDF for documentation, specs, handoff, and print-friendly sharing.

No signup · No watermark · Local browser rendering · High-resolution PDF · Your diagram code stays in your browser

Paste or edit Mermaid code
Replace the sample below, or load another example.
Load example
Paste Mermaid code here. Preview and export load locally in your browser.
Live previewSample preview · Clean Docs

Write

Preview

Export

Docs Asset

Render & export

Export controls activate after your diagram renders locally.

Flowchart
Mode
Default renderNative MermaidOptimized exportStyled download
Export style
Clean DocsGitHub READMEGitHub DarkTransparent DocsWarm Editorial✦ ProWhiteboard Sketch✦ ProAurora Noir✦ ProBlueprint✦ ProChampagne✦ ProEmerald Suite✦ ProEditorial✦ Pro
Scale
1x2x4x
Or exact width, e.g. 1200px wide
Output: White · comfortable padding
Size: calculated after render
Filename: mermaid-flowchart-white-2x.png

When Mermaid to PDF is the right workflow

PDF is useful when diagrams need to travel through documentation reviews, specs, email attachments, and print-oriented handoff flows where recipients may not accept Mermaid source, SVG, or modern image formats.

Specs and design docs

Attach a PDF diagram to product specs, ADRs, implementation notes, and architecture reviews without asking reviewers to render Mermaid.

Client or stakeholder handoff

Use PDF when the recipient expects a document-style asset rather than an editable source file or web image.

Print-friendly sharing

Create a white-page PDF from the rendered diagram so labels, arrows, and boxes remain readable in document workflows.

PNG, JPG, WebP, SVG or PDF: the same diagram in each format

One 16-line flowchart, exported from this editor in the Clean Docs style on a white background at 2x. Sizes change with the diagram, but the ratios between formats hold. Every format is free and has no watermark; the Mermaid to image converter exports all five from one preview.

FormatFile size at 2xTransparent backgroundResizingBest for
PNG178 KBYesFixed pixels — pick 2x or 4xDocs, slides, README files, anywhere
JPG85 KBNo — filled whiteFixed pixelsUpload forms and tools that only take JPG
WebP38 KB (54 KB transparent)YesFixed pixelsWebsites and blogs where page weight matters
SVG147 KB, fonts embeddedYesSharp at any sizeDocs sites and pages viewed in a browser
PDF129 KBNo — white pagePage sized to the diagram; 2x or 4x image insideAttaching, printing, and sending for review

What the exported PDF contains

One page, sized to the diagram rather than to A4 or Letter: the flowchart in the table above becomes a 674 × 272 pt page. The diagram is placed on it as an image rendered at the scale you choose — 129 KB at 2x, 290 KB at 4x — on a white page even when the style is transparent.

Because the diagram is an image, its text cannot be selected or searched inside the PDF. Choose 4x when the PDF will be printed or zoomed, and SVG when you need a vector file. Wide diagrams need the extra pixels most: a sprint plan from the Gantt chart exporter is already almost 3,000 pixels across at 2x, so its day labels are small before the page is even scaled to fit.

Convert a whole Markdown file with Mermaid to PDF

This page exports one diagram at a time. To turn a Markdown document that contains Mermaid blocks into a PDF, the diagrams have to be rendered first:

  • The Mermaid CLI rewrites the Markdown for you: mmdc -i README.md -o README-rendered.md renders each Mermaid block to an SVG file and links it from the output. Convert that file to PDF with your usual Markdown tool.
  • The Markdown PDF extension for VS Code renders Mermaid blocks while it exports. It loads Mermaid from a CDN, so it needs a connection.
  • For a document in Word or Google Docs, export each diagram as PNG and save the document as PDF — see the Word and Google Docs guides. To pick diagrams out of a Markdown file one by one, drop it on the Mermaid file to image page.

PDF export checklist

High-resolution source

The PDF is created from the rendered diagram at the selected export scale, so 2x is the safe default for normal docs.

White PDF page

Transparent presets are flattened onto a white PDF page for reliable viewing and printing across PDF readers.

Need editable vectors?

Use SVG export when you need editable vector markup. The PDF path prioritizes consistent appearance in document workflows.

FAQ

Questions about this Mermaid export workflow

Does Mermaid to PDF run locally?+

Yes. Mermaid rendering, rasterization, and PDF creation happen in your browser for the core workflow. Your diagram code is not uploaded for conversion.

Is the exported PDF editable vector output?+

No. The PDF is generated from a high-resolution rendered image so it matches the preview consistently. Use SVG export when you need editable vector markup.

Can the PDF keep a transparent background?+

PDF export uses a white page background for reliable viewing and printing. Use PNG or WebP when you need transparent image output.

Which scale should I choose for PDF?+

Use 2x for normal documentation and 4x for large diagrams or presentation handoff. If a very large diagram fails, lower the scale or export SVG instead.

How do I export Mermaid to PDF online?+

Paste the Mermaid code into the converter on this page, pick a style and scale, and click Download PDF. The PDF is built in your browser, with no signup and no watermark.

What page size is the Mermaid PDF?+

The page matches the diagram, so there is no empty margin around it. Put it on an A4 or Letter page by inserting it into a document, or by printing it scaled to fit.

How do I convert Markdown with Mermaid diagrams to PDF?+

Render the diagrams first, then convert the Markdown. The Mermaid CLI (mmdc -i input.md -o output.md) replaces each Mermaid block with a rendered SVG, and the Markdown PDF extension for VS Code renders Mermaid blocks as it exports.