Mermaid live editor
To turn Mermaid into a PNG, paste your code or draw the diagram here, then press Export PNG; Export SVG gives a vector file. Both are made in your browser, so nothing is uploaded. Draw on the canvas or write the code, and the other side follows. Hover a node or link and press (+) to grow the diagram.
Runs in your browser. Nothing you paste or draw is uploaded.
Updated
Loading the diagram engine...
How to use it
Step 1: Pick a template (flowchart, sequence, class, ER, Gantt, state or mind map), or paste your own Mermaid code.
Step 2: Edit on the canvas: hover a node and press (+) to add a connected node, or hover a link and press (+) to insert a node into it. Double-click a label to rename it, or click a node in a flowchart to change its shape or colour. Or edit the code beside it. Either side updates the other.
Step 3: Press F or the Full screen button to give the editor the whole window. Esc brings you back and the diagram stays as it was.
Step 4: Copy the link to share the diagram, which is packed into the part of the URL after #. Export SVG or PNG, or copy the code and paste it into a ```mermaid block in your Markdown.
Edit without writing Mermaid
The canvas works on the diagram itself. In flowcharts, state, class and ER diagrams, hovering a node shows a (+) that adds a connected node and a handle you can drag to another node to link them. Hovering a link shows a (+) in its middle that drops a new node into the connection, so A to B becomes A to new node to B. In a flowchart, clicking a node also lets you rename it, change its shape or colour, duplicate it or delete it. Undo and Redo cover canvas edits, typing and templates alike.
Other diagram types get the edits that make sense for them: participants in a sequence diagram, tasks in a Gantt chart, slices in a pie chart, and ideas or periods in mind maps and timelines. Every canvas edit is written into the code as a small text change, so the code beside it stays readable and you can keep working in either place.
Full screen for bigger diagrams
Full screen gives the code, the canvas and the preview the whole window. Use the button or press F when the editor has focus (F is ignored while you type in the code box). Esc or the same button leaves full screen. Where a browser does not allow full screen for a page, such as iPhone Safari, the editor fills the window instead. The page you came from, and your diagram, are untouched either way.
The link is the diagram
The editor stores your code, compressed, in the URL fragment (the part after #). There is no account and no save button: copy the address and send it. Browsers do not send the fragment to a server, so the diagram is not uploaded; anyone you give the link to can read it, so do not put secrets in a diagram you share.
Use the code in Markdown
GitHub, GitLab and many wikis draw a fenced block marked mermaid as a diagram. Copy the code, wrap it in three backticks followed by the word mermaid, and it renders in place. Because the diagram stays plain text, it is reviewed and versioned like the rest of the document.
How do I convert Mermaid to PNG or SVG?
Put the code in the editor (or draw it), check the preview, then press Export PNG or Export SVG under it. The file is called diagram.png or diagram.svg and is saved by your browser. SVG is sharp at any size and good for docs and slides. PNG is rendered at twice the preview size, with a white background in the light theme and a dark one in the dark theme, for places that do not take SVG. Both follow the theme you picked in the editor.
To export from a script or a CI job instead, Mermaid's own command line tool, mermaid-cli, converts a file by the extension of the output.
npm install -g @mermaid-js/mermaid-cli
mmdc -i diagram.mmd -o diagram.png
mmdc -i diagram.mmd -o diagram.svgHow do I draw a Mermaid Gantt chart?
A Gantt chart starts with the word gantt, a dateFormat that says how you write dates, and section lines that group tasks. A task is a title, a colon, then an optional status tag (done, active, crit, milestone), an id, a start and a duration. A start of after d1 begins the task when task d1 ends. The Mermaid Gantt syntax lists everything else, including axisFormat. Paste this in the editor to see it, or pick the Gantt template.
gantt
title Website launch
dateFormat YYYY-MM-DD
axisFormat %d %b
section Design
Wireframes :done, d1, 2026-11-02, 5d
Visual design :active, d2, after d1, 7d
section Build
Frontend :b1, after d2, 10d
Backend :b2, after d2, 12d
section Launch
Release :milestone, m1, after b2, 0dHow do I draw a Mermaid ER diagram?
An ER diagram starts with erDiagram. Each relationship line is two entities, a pair of cardinality markers around a line, and a label after a colon. Attributes go in braces after an entity, as a type and a name, with an optional key (PK, FK or UK). Per the Mermaid ER syntax, each side of a line has two characters: the outer one is the maximum and the inner one the minimum.
erDiagram
CUSTOMER ||--o{ ORDER : places
ORDER ||--|{ LINE_ITEM : contains
PRODUCT ||--o{ LINE_ITEM : "is in"
CUSTOMER {
int id PK
string email UK
}
ORDER {
int id PK
int customer_id FK
}| Meaning | Left side | Right side |
|---|---|---|
| Zero or one | |o | o| |
| Exactly one | || | || |
| Zero or more | }o | o{ |
| One or more | }| | |{ |
So CUSTOMER ||--o{ ORDER reads: one customer has zero or more orders. A solid line (--) marks an identifying relationship and a dashed one (..) a non-identifying one.
What it does not do
- The canvas edits the structure and style of a diagram (nodes, links, labels, shapes, colours), not its layout. Mermaid places the shapes, so you cannot drag a node to a position of your choice.
- Not every diagram type can be edited on the canvas. Git graph, journey, quadrant and other types still draw, and you edit them in the code.
- If the code has a syntax error, the canvas and the exports keep the last diagram that worked until you fix it.
- Very large diagrams can take a few seconds to draw. Mermaid itself limits the size of the text it accepts.
- Beta diagram types may differ between Mermaid versions, so a diagram can look different on GitHub or in your wiki than here.
- Icons and fonts that Mermaid loads from other sites are not available offline.
- Export is one diagram at a time, as PNG or SVG. There is no PDF export, no batch export and no transparent PNG; for those use mermaid-cli.
Diagrams that live with your docs
In Folio, these diagrams live in your wiki pages as code in Git, and you edit them with the same visual editor or in the code. A change to a diagram is a reviewable change to a text file.
Read more: Mermaid diagrams in a team wiki: keep them as code.
Frequently asked questions
How do I convert Mermaid to PNG?
Paste the code in the editor above and press Export PNG under the preview. The PNG is made in your browser at twice the preview size. Press Export SVG for a vector file. For scripts and CI, use mermaid-cli: mmdc -i diagram.mmd -o diagram.png.
Can I get a transparent PNG?
Not from this editor: the PNG has a white or dark background matching the theme so that text stays readable anywhere. For a transparent background, export SVG, or use mermaid-cli, which has a background option.
How do I make a Gantt chart in Mermaid?
Start with gantt, set dateFormat, add section lines and write tasks as Title :status, id, start, duration. Use after id as the start to chain tasks. A full example is in the Gantt section above, and the Gantt template in the editor draws a similar one.
How do I draw an ER diagram in Mermaid?
Start with erDiagram, then write relationships such as CUSTOMER ||--o{ ORDER : places. The markers give the cardinality: || is exactly one, o{ is zero or more. Attributes go in braces after an entity. See the ER section above for an example and the marker table.
Is the Mermaid editor free, and is my diagram sent to a server?
It is free, without sign-up, and nothing is uploaded: Mermaid draws the diagram in your browser. The share link keeps the code in the part of the URL after #, which browsers never send to a server. Anyone with the link can read the diagram.
Why do I get a syntax error?
Mermaid is strict about its syntax. The message under the editor shows the line and what the parser expected. The usual causes are a missing arrow, an unclosed bracket, or a special character in a label that needs to be in quotes.
More free tools
All toolsAlso free: Markdown templates for meeting notes, SOPs, PRDs, runbooks and more.