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.
PNG export · safest sharing format
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
Export controls activate after your diagram renders locally.
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.
Use transparent PNG when the diagram needs to sit on a branded slide, dark section, or presentation card without a white box.
PNG is the safest fallback for documentation systems that do not render Mermaid consistently or block inline scripts.
Export at 2x or 4x so labels and arrows stay readable after CMS resizing, social previews, or ticket attachments.
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.
| Format | File size at 2x | Transparent background | Resizing | Best for |
|---|---|---|---|---|
| PNG | 178 KB | Yes | Fixed pixels — pick 2x or 4x | Docs, slides, README files, anywhere |
| JPG | 85 KB | No — filled white | Fixed pixels | Upload forms and tools that only take JPG |
| WebP | 38 KB (54 KB transparent) | Yes | Fixed pixels | Websites and blogs where page weight matters |
| SVG | 147 KB, fonts embedded | Yes | Sharp at any size | Docs sites and pages viewed in a browser |
| 129 KB | No — white page | Page sized to the diagram; 2x or 4x image inside | Attaching, printing, and sending for review |
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 transparentScale 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.
Choose a transparent preset before exporting. PNG preserves alpha; JPG flattens the background.
Use 2x for normal docs and 4x for presentations, retina screenshots, or large cards.
Use PNG for compatibility, then switch to WebP when the target is a modern website and file size matters.
FAQ
Yes. The PNG exporter is free for single-diagram use and does not add a watermark to the exported image.
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.
Most platforms resize images. Export at 2x for documentation and 4x for slides or retina displays so text and connectors stay sharp after scaling.
Choose PNG for maximum compatibility, SVG for vector workflows, JPG for legacy upload forms, and WebP for modern web pages where file size matters.
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.
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.
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.
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.
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.
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.
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.