Mermaid Live Editor
What's included
Features
About this tool
A Place to Preview and Fix the Diagram Your AI Just Wrote
Ask an AI assistant for a flowchart, a database diagram or a project timeline and it will usually answer with Mermaid code, a few lines of text that a renderer turns into a picture. The code is easy to get and awkward to check: it only becomes a diagram somewhere that supports Mermaid, and when it has a syntax error you often get nothing and no hint why.
This editor gives you that missing step. Paste the code, fence and all, and see the diagram straight away. If something is wrong the line number is highlighted with a plain-English message while the preview keeps the last working version, and one click copies a ready-made fix request to send back to your assistant. Pick a template to start from a flowchart, sequence diagram, class diagram, state diagram, entity relationship diagram, Gantt chart, pie chart, mind map, user journey or Git graph, then edit it live.
When it looks right, export it. SVG stays sharp at any size, PNG and a 4x PNG suit slides and documents, and you can choose a white, transparent or dark background. Copy for Markdown wraps the code in a mermaid block for a README or wiki, and Share link stores the whole diagram inside the web address so a colleague can open exactly what you see, with nothing uploaded to a server.
The diagram is drawn in your browser with Mermaid version 10, loaded from a public CDN the first time you open the page. Your code stays on your device, and the last diagram is remembered in your own browser. If you write documentation with it, Markdown Editor previews the rest of the page, Diff Checker compares two versions of a diagram's code, and AI Prompt Studio helps you ask for better diagrams in the first place.
Step by step
How to Use
- 1Paste your Mermaid codePaste the code an AI assistant gave you, fence and all. If it arrives wrapped in a mermaid code block, the editor takes the wrapper off for you. You can also open a .mmd, .md or .txt file, or pick a diagram type from Start from to load a working example. The preview draws as you type, after a short pause.
- 2Fix any error it reportsIf the code has a mistake, the line number is highlighted in the editor and a plain-English message appears under it. The preview keeps showing the last working version so you can see what changed. Press Copy fix prompt for your AI to copy a ready-made request, with the error and your code, to paste back into your assistant.
- 3Choose a theme and directionPick Default, Neutral, Forest, Dark or Base. Choosing Dark also switches the background to dark, and you can change the export background to white, transparent or dark at any time. For a flowchart, Flow direction flips it between top to bottom, left to right, bottom to top and right to left.
- 4Zoom and move aroundDrag the diagram to move it, hold Ctrl (or Cmd on a Mac) and scroll to zoom, or use the plus and minus buttons. Full screen gives the diagram the whole window, Escape leaves it, and Reset puts it back in the middle.
- 5Export the diagramDownload SVG for a sharp image that scales, PNG for slides and documents, or PNG 4x for a large, crisp image. Copy SVG puts the markup on your clipboard, and Save .mmd downloads the code itself.
- 6Copy it for MarkdownCopy for Markdown wraps your code in a mermaid code block, which GitHub, GitLab, Notion and many docs tools render as a diagram.
- 7Share a linkShare link copies a web address with the whole diagram stored inside it. Anyone who opens it sees the same diagram and can edit their own copy. Nothing is saved on a server.
Real-world uses
Common Use Cases
Got questions?
Frequently Asked Questions
Mermaid is a text-based way to describe diagrams. You write a few lines such as "flowchart TD" followed by arrows between boxes, and a renderer draws the picture. It is built into GitHub, GitLab, Notion, Obsidian and many documentation tools, and AI assistants often answer with Mermaid code when you ask for a flowchart or an architecture diagram.
Copy the code from inside the mermaid code block, leaving out the three backticks and the word mermaid, and paste it into the editor. The diagram appears on the right. If the assistant made a syntax mistake, the error message and line number show you where to fix it.
No. If your whole paste is one fenced mermaid block, the editor removes the fence automatically and draws the diagram. That means you can copy a reply from ChatGPT, Claude or Gemini and paste it exactly as it is.
Read the highlighted line and message, then press Copy fix prompt for your AI. It copies a short request that contains the error and your code, so you can paste it straight back into the assistant and ask for a corrected version. Paste the new answer here to check it.
Flowcharts, sequence diagrams, class diagrams, state diagrams, entity relationship diagrams, Gantt charts, pie charts, mind maps, user journeys and Git graphs, and the other types supported by Mermaid version 10. The Start from menu loads a working example of each of the main ones, and a Flow direction menu appears for flowcharts.
The most common causes are a missing diagram type on the first line, an arrow with nothing after it, text with brackets or quotes that is not wrapped in quotes, and a reserved word such as end used as a node name. The editor highlights the line the parser stopped on, which is usually at or just after the real mistake.
Use the SVG, PNG or PNG 4x buttons above the editor. SVG stays sharp at any size and suits web pages and print. PNG is better for slides and chat. Choose a white, transparent or dark export background first if you need one.
Yes. GitHub and GitLab render a code block marked mermaid as a diagram. Copy for Markdown wraps your code in that block, so you can paste it straight into a README, an issue or a pull request.
The diagram code is encoded into the part of the web address after the # sign. Opening the link loads that code into the editor. Because that part of an address is not sent to a server, nothing is stored or uploaded, but anyone you give the link to can read the diagram.
No. Drawing happens in your browser, and the last diagram is kept only in your own browser's local storage so it is there when you come back. Clearing site data removes it. The Mermaid library itself is loaded from a public CDN the first time you open the page.
For reliable exports the tool draws labels as plain SVG text rather than HTML, and adds the background colour you chose. The shapes and layout are the same, and very large diagrams are capped at 8,000 pixels on the longest side for PNG.
Yes. On a small screen the code box sits above the preview. You can drag the diagram with a finger, and exports and share links work the same way.