Write Mermaid syntax in the code editor and instantly see your flowchart, sequence diagram, class diagram, ER diagram, or Gantt chart rendered in the preview. Export as SVG or PNG, copy the Mermaid source, or share a link — all in your browser.
The Mermaid Diagram Editor is a live browser-based tool for every Mermaid diagram type. Type any valid Mermaid syntax — flowcharts, sequence diagrams, class diagrams, ER diagrams, Gantt charts, pie charts, state diagrams, git graphs, and more — and the preview panel renders the result instantly as you type. Switch layout direction between top-down, left-right, bottom-up, and right-left with one click. Adjust zoom to inspect fine details. When your diagram is ready, export it as a crisp vector SVG, a 2× retina-quality PNG with your chosen background color, or copy the raw Mermaid markup to embed in GitHub READMEs and Markdown docs.
QWhat diagram types does Mermaid support?
Mermaid supports flowcharts (`graph`/`flowchart`), sequence diagrams, class diagrams, ER diagrams, state diagrams, Gantt charts, pie charts, user journeys, git graphs, quadrant charts, and more. All types are supported in this editor.
QDoes the diagram update automatically?
Yes. The preview re-renders 600 ms after you stop typing. You can also click the circular Render button between the two panels to force an immediate render.
QHow do I change the background color?
Click the palette icon (🎨) in the preview toolbar. You can choose Auto (follows your light/dark theme), Transparent, a preset color, or enter any custom hex color. The selected background is applied to the preview canvas and baked into both SVG and PNG exports.
QWhy does the diagram look different in light vs dark mode?
The editor automatically re-renders the diagram with a contrasting color palette when you toggle between light and dark themes — light mode uses blue-on-white tones, dark mode uses a navy-and-sky palette.
QCan I share my diagram with others?
Yes. Click the share icon in the toolbar to copy a link that encodes your Mermaid code into the URL. Anyone who opens the link will see the same diagram loaded in the editor.
QWhat is the difference between the SVG and PNG downloads?
SVG is a scalable vector format — ideal for presentations, Figma, or anywhere you need crisp output at any size. PNG is exported at 2× (retina) resolution with the selected background color filled in, making it suitable for Confluence, Notion, Slack, or any raster context.