Free Online Mermaid Playground
Turn text into flowcharts, sequence diagrams, class diagrams and Gantt charts. The diagram updates as you type, a Config tab sets themes and options, and syntax errors show in the preview.
Auto-run is on, so the diagram updates as you type. Write Mermaid text such as a flowchart, sequence, class or Gantt diagram. The Config tab sets the theme, fonts and diagram options.
Preview
How to use
Write Mermaid text in the Diagram tab, starting with the diagram type, such as flowchart or sequenceDiagram.
Watch the diagram update as you type, or turn off Auto-run and press Run.
If there is a mistake, read the message shown in the preview.
Optionally open the Config tab to change the theme, fonts or diagram options.
Copy the text, download a zip of your files or clear the editor with the icons above it.
Open the full screen editor for more room, and use the A buttons to resize the text.
Press Format to tidy the Config tab (diagrams have no standard layout to tidy), or untick Wrap long lines to scroll sideways instead.
Why use this tool
Many diagram types
Flowcharts, sequence, class, state and entity relationship diagrams, Gantt charts, pie charts, mind maps and more.
Live preview
See the diagram a moment after you stop typing.
Themes and options
The Config tab sets the theme, look, fonts and the options of each kind of diagram, such as flowchart curves and sequence numbers.
Clear errors
Syntax errors are shown as text in the preview, not as a broken image.
Strict mode
The diagram renders in an isolated frame in Mermaid's strict mode, so HTML and scripts in labels are not run.
One-click formatting
Tidy the indentation and spacing of the tab you are editing with one click or Shift + Alt + F. Works on the Config tab, not on diagrams.
Comfortable editor
Resize the text, switch line wrapping on or off, or go full screen with the editor and preview side by side.
About this tool
Turn text into diagrams with Mermaid and watch them update as you type. Write Mermaid syntax for flowcharts, sequence diagrams, class diagrams, state diagrams, Gantt charts and more. A mistake shows its error in the preview, so it is easy to fix. The Config tab sets the theme, fonts and options for each kind of diagram, and Download saves a zip with an HTML page that renders the diagram, plus your diagram and config as separate files.
Frequently asked questions
Anything the Mermaid version used here supports, including flowcharts, sequence diagrams, class diagrams, state diagrams, entity relationship diagrams, Gantt charts, pie charts and mind maps.
Yes. Open the Config tab and set theme to default, neutral, forest, dark or base, and look to classic or handDrawn. You can also set the font, theme variables such as colours (these work with the base theme), and options for each kind of diagram, such as flowchart curves.
No. The security settings are fixed by the playground, so a config cannot make the preview less safe. If you try to set one, a notice in the Config tab says it was ignored.
Not yet. Download saves a zip with an HTML page that renders the diagram. For an image, take a screenshot of the preview.
Yes. Mermaid is loaded from a public CDN the first time you use the playground. Your browser keeps it afterwards.
The preview shows the error message from Mermaid. Fix the line it points to and the diagram renders again.
Yes. The text is rendered in Mermaid's strict mode inside an isolated frame, so HTML or scripts in labels are not run.
Not the diagram itself, because Mermaid syntax has no standard layout to tidy it into. The Format button works on the Config tab. Your diagram is easier to read if you indent the lines inside each block.
Yes. Untick Wrap long lines under the editor and it scrolls sideways instead. Your choice is remembered on this device.