Mermaid.js Live Diagram Editor

Create and preview Mermaid.js diagrams in real time — flowcharts, sequences, Gantt, ERDs, and more

  1. Home
  2. /
  3. Mermaid.js Live Editor

Preview

Click Render to preview diagram

What Is Mermaid.js?

Mermaid.js is a JavaScript-based diagramming and charting tool that renders Markdown-inspired text definitions into diagrams. It supports flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts, pie charts, ER diagrams, mind maps, and more. It's widely used in documentation, wikis, and README files.

How to Use This Editor

  1. Write Mermaid markup — Type or paste Mermaid.js syntax into the input area. Start with a diagram type declaration like graph TD (flowchart), sequenceDiagram, gantt, or mindmap.
  2. Try examples — Click the example buttons (Flowchart, Sequence, Gantt, ERD, Mindmap) to load pre-written diagram code instantly.
  3. Click Render — Press "Render" to generate and display the diagram in the preview panel.
  4. Export your diagram — Click "Export SVG" or "Export PNG" to download the rendered diagram as a vector or raster image file for use in documentation, presentations, or reports.
  5. Iterate and refine — Edit the markup and re-render as needed. The live preview helps you perfect your diagram before exporting.

Frequently Asked Questions

What diagram types does Mermaid.js support?

Mermaid supports flowcharts, sequence diagrams, class diagrams, state diagrams, ER diagrams, Gantt charts, pie charts, requirement diagrams, git graphs, mind maps, timeline diagrams, C4 context diagrams, and block diagrams — each with its own syntax flavor.

Can I use Mermaid in Markdown files?

Yes! Mermaid is natively supported in many platforms including GitHub, GitLab, Notion, Confluence, and Markdown editors. Simply wrap your Mermaid code in a ```mermaid code fence. This tool helps you create and test the diagram code before embedding it.

What file formats can I export?

You can export your diagrams as SVG (Scalable Vector Graphics) for high-quality scalable images, or PNG (Portable Network Graphics) for raster images suitable for embedding in documents and presentations. SVG is recommended for web use and documentation.

Why is my diagram not rendering?

Common issues include syntax errors in the Mermaid markup, incorrect diagram type declarations, or mismatched brackets. Check the error message displayed below the input area, and use the example buttons to see correctly formatted code for each diagram type.

Is my diagram data sent to a server?

No. All diagram rendering is done locally in your browser using the Mermaid.js library. Your diagram code and rendered output never leave your device.

Last updated: 9 Jul 2026