Image attachments
Use the exported PNG in destinations that accept standard raster images.
Browser-based image export
Convert Mermaid code into a PNG for a slide, ticket, document, or message attachment. Preview the diagram above and click the PNG button at the top right of the preview when the destination needs an ordinary raster image.
The request-confirmation example below is suitable for a short API explanation. Check readability at the intended display size before exporting.
PNG is useful where Mermaid code is not rendered and SVG is not accepted. Its fixed pixels make the final display size an important part of the export decision.
Use the exported PNG in destinations that accept standard raster images.
The current export uses a dark background for the dark theme and a white background for other themes.
The image size follows the rendered diagram and device scaling; there is no custom width or height control here.
Retain the source, adjust the diagram, and export a new image when the explanation changes.
Choose the layout for the destination before producing a fixed-pixel image.
Paste Mermaid source or adapt the request example and wait for a successful preview.
Check label length, diagram width, and contrast. Choose the dark theme only when its dark export background is appropriate.
Click the PNG button at the top right of the preview, then inspect the downloaded image at the size it will appear in the slide or document.
The current tool exports the rendered diagram with a filled background. It does not offer transparent PNG or a custom pixel-size preset.
PNG image format guide (MDN) →Dark-theme exports use a dark background; other themes use white. Choose the theme before export and check that the result fits the destination. Transparency is not an option in this tool.
Export uses the rendered dimensions and browser device scaling up to 2x. It is not a fixed 4K output or a control for choosing an arbitrary width and height.
Shorten labels, use a direction that suits the page, or split an oversized explanation into separate diagrams. Stretching an exported PNG does not add detail.
Keep the Mermaid source for later editing. Use SVG when the destination supports it and you need the diagram to remain sharp at multiple sizes.
This illustrative change-review process has one decision, two labeled exits, and a retry loop. Paste the complete source into the editor. Follow both branches before exporting: rejection must return through Revise proposal, while approval ends at Schedule release. Keep the labels short enough to read at the size used in the ticket.
flowchart LR
Request[Receive change request] --> Review{Approved?}
Review -->|Yes| Release[Schedule release]
Review -->|No| Revise[Revise proposal]
Revise --> ReviewIf the preview shows a parsing error, confirm that the first line declares flowchart LR and that every bracket and decision brace is closed. Use stable IDs such as Review and keep display text inside brackets. For a label with punctuation, quote it, for example Step["Review (manual)"]. Re-render after each small change; an error in the source cannot be fixed by downloading the image again.
First open the downloaded file itself and inspect its dimensions. If it is sharp there but blurred in a slide, reduce the display size or use SVG when supported. If the image is already too dense, shorten labels, change LR to TD, or split the process into separate diagrams; preview zoom is not an export-resolution setting. If a host crops the picture, check that host’s fit or crop setting before changing the source. PNG output uses a theme-dependent background, so choose a light theme for light documents and check contrast in the destination.
The request-confirmation interaction shows a customer, an API, and a data store. Its short messages are readable as an image in a ticket or presentation.
sequenceDiagram
actor Customer
participant API as Orders API
participant Store as Order Store
Customer->>API: Place order
API->>Store: Save validated order
Store-->>API: Order ID
API-->>Customer: Confirm orderNo. The current PNG export fills a background: dark for the dark theme, white for other themes.
There is no custom pixel-size selector on this page. The output follows the rendered diagram dimensions and browser scaling up to 2x.
PNG contains a fixed number of pixels. Display it near its exported size, simplify or split dense content, or choose SVG when the destination supports scalable vectors.
Preview zoom is for inspecting the diagram; it is not a custom export-size control. Check the downloaded file itself at the intended display size.
No. You can paste the Mermaid source directly into the editor. Resolve any syntax error, then click the PNG button at the top right of the preview.
A PNG is a rendered image, not editable Mermaid source. Edit the retained source in the editor and export again.
Further reading
Compare syntax and modeling capabilities when choosing a diagram language for technical documentation.
Read the diagram language comparison →