Mermaid Online

PNG export · safest sharing format

Free Mermaid to PNG Converter

Paste Mermaid code, preview it instantly, then export a clean PNG for slides, README files, blog posts, issue trackers, and documentation. PNG is the safest default when the diagram must look exactly as exported.

No signup · No watermark · Local browser rendering · Transparent background · 1x / 2x / 4x output

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

Why PNG is the primary Mermaid export format

PNG has the broadest destination support for Mermaid diagrams. It works in slide decks, GitHub issues, CMS editors, email builders, Word documents, README files, and internal docs without requiring the destination platform to understand Mermaid or allow SVG.

Slides and decks

Use transparent PNG when the diagram needs to sit on a branded slide, dark section, or presentation card without a white box.

README and docs

PNG is the safest fallback for documentation systems that do not render Mermaid consistently or block inline scripts.

Blogs and issue trackers

Export at 2x or 4x so labels and arrows stay readable after CMS resizing, social previews, or ticket attachments.

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

Convert a .mmd file to PNG

A .mmd file is plain Mermaid text, so it converts exactly like code you paste. Open the file in the Mermaid viewer, or drop it — or a Markdown file full of diagrams — on the Mermaid file to image page, then download PNG. Nothing is uploaded; the file is read in your browser.

In a build script or CI job, the official Mermaid CLI does the same from a terminal. -s sets the scale and -b the background:

npx -p @mermaid-js/mermaid-cli mmdc -i diagram.mmd -o diagram.png -s 2 -b transparent

1x, 2x or 4x: what the numbers mean

Scale multiplies the size Mermaid draws the diagram at. The flowchart in the table above is 899 × 363 px at 1x (74 KB), 1798 × 726 px at 2x (178 KB) and 3596 × 1452 px at 4x (421 KB). Use 2x for documents and web pages, and 4x for slides, print and large screens — the high-resolution export guide covers fixed widths, and why screenshots look blurry explains what a 1x screenshot loses.

If the PNG is going on a website and file size matters, the same 2x image as WebP is 38 KB instead of 178 KB. For a slide with a coloured background, keep PNG and switch on a transparent background.

PNG export checklist

Need transparency?

Choose a transparent preset before exporting. PNG preserves alpha; JPG flattens the background.

Need sharp text?

Use 2x for normal docs and 4x for presentations, retina screenshots, or large cards.

Need smaller web files?

Use PNG for compatibility, then switch to WebP when the target is a modern website and file size matters.

FAQ

Questions about this Mermaid export workflow

Can I export a Mermaid diagram as PNG without a watermark?+

Yes. The PNG exporter is free for single-diagram use and does not add a watermark to the exported image.

Can the PNG have a transparent background?+

Yes. Use a transparent export preset and download PNG. The checkerboard preview is only a visual aid; it is not drawn into the exported file.

Why does my Mermaid PNG look blurry after uploading?+

Most platforms resize images. Export at 2x for documentation and 4x for slides or retina displays so text and connectors stay sharp after scaling.

Should I choose PNG, SVG, JPG, or WebP?+

Choose PNG for maximum compatibility, SVG for vector workflows, JPG for legacy upload forms, and WebP for modern web pages where file size matters.

How do I export a PNG with a white, transparent, or dark background?+

Choose a background preset before exporting: white for a self-contained image, transparent to drop the background box, or a dark preset to match dark slides and docs. The choice is applied to the downloaded PNG.

How do I convert Mermaid code to a PNG online for free?+

Paste your Mermaid code into the editor, preview it, then click Download PNG. It runs online in your browser — free, no signup, no watermark — and your code is not uploaded.

Can I convert a .mmd file to PNG?+

Yes. Paste the code from the .mmd file into the editor and export PNG, or drop the file itself on the Mermaid file to image page, which reads .mmd, .mermaid and Markdown files in your browser. A .mmd file is just Mermaid text, so it renders exactly the same as inline code.

What resolution is the exported Mermaid PNG?+

1x exports the diagram at the size Mermaid draws it, 2x doubles the width and height, and 4x quadruples them; the exporter shows the exact pixel dimensions before you download. For a fixed size, type a width between 32 and 10,000 pixels and the height follows the diagram's proportions.

Can I convert Mermaid to PNG from the command line?+

Yes — the official Mermaid CLI (mmdc, the npm package @mermaid-js/mermaid-cli) renders .mmd files to PNG in a terminal and fits CI pipelines and scripted builds. For one-off conversions this page is faster: paste the code, preview it, and download — nothing to install, and rendering runs in your browser.

Can I batch-convert multiple Mermaid files to PNG at once?+

Not yet — the editor converts one diagram at a time. To process many files today, loop the Mermaid CLI (mmdc) over your .mmd files in a shell script. Batch workflows are the leading candidate for a future paid tier.

Is there a Mermaid to PNG converter that works offline?+

The Mermaid CLI (mmdc) runs without a browser tab and converts .mmd files to PNG on your own machine; it needs Node.js. This page needs a connection to load, then renders and exports the diagram in your browser without uploading the code.