Browser-based image export

Mermaid to PNG Converter

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.

Convert Mermaid source to PNG

The request-confirmation example below is suitable for a short API explanation. Check readability at the intended display size before exporting.

OnUML
Loading diagram preview...

Deliver a diagram as a regular image

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.

Image attachments

Use the exported PNG in destinations that accept standard raster images.

Theme-based background

The current export uses a dark background for the dark theme and a white background for other themes.

Rendered image dimensions

The image size follows the rendered diagram and device scaling; there is no custom width or height control here.

Repeatable updates

Retain the source, adjust the diagram, and export a new image when the explanation changes.

Convert Mermaid to a readable PNG

Choose the layout for the destination before producing a fixed-pixel image.

  1. 01

    Paste Mermaid source or adapt the request example and wait for a successful preview.

  2. 02

    Check label length, diagram width, and contrast. Choose the dark theme only when its dark export background is appropriate.

  3. 03

    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.

PNG background, size, and readability

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) →

The output has a background

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.

Pixel size follows the render

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.

A dense diagram needs a layout change

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 source and consider SVG

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.

Worked example: an approval loop for a ticket

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 --> Review

Fix syntax errors before investigating the PNG

If 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.

Diagnose blur, cropping, and background differences

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.

Mermaid to PNG example

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 order
  • The diagram explains the order of calls and responses without listing every implementation step.
  • Check message text at the slide or ticket display size, not only in a zoomed editor preview.
  • Try adding an error branch. If the interaction grows too wide, split the success and recovery explanations before exporting.

Frequently asked questions

Can I export a transparent PNG?

No. The current PNG export fills a background: dark for the dark theme, white for other themes.

Can I choose an exact width or height?

There is no custom pixel-size selector on this page. The output follows the rendered diagram dimensions and browser scaling up to 2x.

Why does the image look blurry when enlarged?

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.

Will zooming the preview set the PNG resolution?

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.

Do I need to upload a file first?

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.

Can I change the diagram inside the PNG later?

A PNG is a rendered image, not editable Mermaid source. Edit the retained source in the editor and export again.

Further reading

Compare Mermaid and PlantUML

Compare syntax and modeling capabilities when choosing a diagram language for technical documentation.

Read the diagram language comparison →