Presentation slides
Place diagrams on branded Keynote, PowerPoint, or Google Slides backgrounds without a white rectangle.
Transparent background · slides and dark docs
Create Mermaid diagrams that sit cleanly on slides, dark documentation, branded cards, and custom page backgrounds. Preview on a checkerboard, then export a transparent PNG or WebP without a watermark.
No signup · No watermark · Transparent preview · Local browser rendering · Best for slides and branded layouts
Export controls activate after your diagram renders locally.
Transparent export removes the background around the Mermaid diagram while keeping nodes, labels, and connectors readable. It is best paired with a theme that has enough contrast for the destination background.
Place diagrams on branded Keynote, PowerPoint, or Google Slides backgrounds without a white rectangle.
Use transparent export with a readable theme when diagrams need to sit inside dark docs or product pages.
Create diagram assets that can be layered on editorial cards, hero sections, and visual explainers.
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 |
Mermaid itself draws no background: the SVG it renders has no fill behind the diagram, so it shows whatever sits underneath. The white box comes from somewhere else — the page or editor the diagram is shown in, a screenshot that captures that page, or the Mermaid CLI, whose -b background option defaults to white.
The background theme variable does not paint the canvas either; Mermaid only uses it to work out other colours. To get a transparent file, export it transparent: mmdc -i diagram.mmd -o diagram.png -b transparent on the command line, or the Transparent background switch in the editor above, which saves a transparent PNG or WebP. An SVG export is transparent by default.
Even on a transparent canvas, Mermaid fills two kinds of box: the background behind edge labels and the fill of each subgraph. Both come from theme variables, so a config block at the top of the diagram clears them:
---
config:
theme: base
themeVariables:
edgeLabelBackground: 'transparent'
clusterBkg: 'transparent'
---
flowchart LR
subgraph app["App"]
a[Client] -->|calls| b[API]
endSubgraphs keep their outline, so the grouping still reads. On a dark slide, pair transparency with a dark style such as GitHub Dark so the lines and text stay visible — the themes page shows every style, and the PowerPoint guide walks through placing the PNG on a slide.
Documents, wikis and email are white already, and some tools show transparent areas as black or as a checkerboard. For those, export with the White background so the image carries its own canvas — the Word and Google Docs guides use it. JPG and PDF are always white, because neither format stores transparency.
PNG is the safest transparent format for slide decks and documentation screenshots.
JPG cannot preserve transparency. It will flatten the diagram onto a solid background.
Transparent does not mean universally readable. Choose a theme that contrasts with the final slide or page background.
FAQ
PNG is the safest transparent format. WebP can also preserve transparency in modern browsers. JPG does not support transparency.
No. The checkerboard is only a preview aid so you can see transparent areas on the page.
The canvas is transparent, but a light style still draws dark lines and dark text meant for white pages. Switch to a dark style such as GitHub Dark, which is free, and keep Transparent background on.
Yes. Use transparent PNG at 2x or 4x for PowerPoint, Keynote, or Google Slides.
Use transparent when the diagram sits on a colored, branded, or dark background so there is no white box around it. Use a solid white background when the destination is already white and you want a predictable, self-contained image.
Yes. Choose GitHub Dark, a free style, to export on a dark canvas, or turn on Transparent background so your own dark slide shows through.
Yes. Mermaid SVG output has no background fill of its own, so it shows whatever sits behind it. That makes SVG a good transparent choice for web pages and Microsoft 365 documents; use PNG when the destination does not accept SVG.
Pass the background flag: mmdc -i diagram.mmd -o diagram.png -b transparent. If you do not want to install Node and Puppeteer for a one-off image, paste the code into the tool above and export a transparent PNG at 2x or 4x instead.
Yes. mermaid.ink returns transparent images by default and accepts a bgColor query parameter when you need a solid color. Use this editor when you want to preview the transparent result on a checkerboard and pick a theme that stays readable on your slide before you download.
Mermaid's SVG has no background fill, so the white comes from where the diagram is shown: the page, an editor's canvas, a screenshot of it, or the Mermaid CLI, which uses a white background unless you pass -b transparent.
Set edgeLabelBackground to 'transparent' under themeVariables in the diagram's config block, with theme: base. Add clusterBkg: 'transparent' as well to clear the fill inside subgraphs.