Mermaid live editor
A free Mermaid live editor online: type Mermaid on the left, see the diagram redraw on the right, then download it as SVG, PNG or PDF or share it as a link.
The share link carries the diagram inside the link itself; nothing is stored on a server.
How to use it
- Pick an example to start from, or paste your own Mermaid code.
- Edit the code: the preview redraws as you type, and a syntax error shows the line Mermaid stopped at.
- Choose a theme, then download SVG, PNG or PDF, or copy a link that opens this exact diagram.
What Mermaid is
Mermaid is an open-source language that turns short text into diagrams. Since 14 February 2022 GitHub has drawn any ```mermaid code block in a Markdown file as a diagram, and GitLab, Notion and Obsidian do the same, so a diagram can live next to the text it explains and change in the same commit.
This editor runs the official Mermaid library (version 12) in your browser. Code that renders here renders the same way in any tool on a recent Mermaid version.
Your first diagram, line by line
A Mermaid flowchart is a first line that names the direction, then one line per connection. This five-line example draws an idea, a question and two outcomes:
| Line | What it does |
|---|---|
flowchart LR | Starts a flowchart drawn left to right. TB or TD draws top-down, BT bottom-up, RL right to left. |
A[Idea] --> B{Worth it?} | A rectangle with the id A, an arrow, and a diamond with the id B. The id is how later lines refer to a shape. |
B -->|Yes| C[Build it] | An arrow labelled Yes from B to a new rectangle C |
B -->|No| D([Drop it]) | A labelled arrow to a stadium-shaped node, the usual start or end symbol |
C --> E((Ship)) | An arrow to a circle |
Diagram types you can write
The first line names the diagram type. The ones people use most:
| First line | Draws |
|---|---|
flowchart TD (or LR) | A flowchart, top-down or left-right |
sequenceDiagram | Messages between people or systems over time |
gantt | A project schedule with tasks and dates |
mindmap | A mind map from an indented list |
classDiagram, erDiagram | Software models and database tables |
stateDiagram-v2 | States and the transitions between them |
timeline, pie, quadrantChart | Timelines, pie charts and 2×2 matrices |
When Mermaid shows an error
Mermaid stops at the first line it cannot read, and this editor shows its message with that line. Most errors come from a short list, and the Mermaid documentation names the first two itself:
- The word
endin lowercase inside a flowchart node breaks the chart. WriteEndorEND. - A node whose name starts with
oorxright after a link (dev---ops) is read as a special arrow end. Add a space or a capital:dev--- ops. - Brackets, quotes or a
|inside a label confuse the parser. Wrap the label in double quotes, and write a double quote inside it as#quot;. - The first line is missing or misspelt. Every diagram must open with its type, such as
flowchart TDorsequenceDiagram. - Very large diagrams hit Mermaid’s built-in limits: by default it refuses code longer than 50,000 characters and flowcharts with more than 500 links. Split such a diagram into parts.
Sharing and privacy
The share link compresses your code and theme with deflate and puts the result after #m= in the address. Browsers never send the part after # to a server, so the diagram travels only inside the link. Long diagrams make long links; for a very large diagram, send the SVG or the code itself instead.
Your latest code is also kept in this browser, so it is waiting when you come back. Rendering uses Mermaid’s strict security level: HTML tags in the text are encoded and click actions are turned off, so a pasted diagram cannot run code on this page.
Typing or drawing
Mermaid suits diagrams that change with code or documents, because a text diff shows exactly what changed. If you would rather place shapes by hand, draw the chart in the flowchart maker and press Copy as Mermaid to bring it here. For a dated sequence of events, the timeline maker spaces events by their real dates, while Mermaid’s timeline type treats each period as a label, not as a date.
Related tools
Questions people ask
Is this the official Mermaid Live Editor?
No. It is an independent editor built on the official open-source Mermaid library, with export, themes and share links. The official one is at mermaid.live.
Is it free, and does it need an account?
It is free, with no account and no watermark. Your code stays in this browser unless you share a link yourself.
Why does my diagram show an error?
Mermaid stops at the first line it cannot read and names it. The usual causes are a lowercase “end” in a flowchart node, brackets or quotes in an unquoted label, and a missing first line.
Can I use it as a Mermaid viewer?
Yes. Paste the code from a .mmd file or a Markdown code block (without the ``` lines) and the diagram appears; download it as SVG or PNG if you need a picture.
Can I use the SVG in a document or slide?
Yes. The SVG is a vector that stays sharp at any size and carries its font inside the file. Use PNG where a tool does not accept SVG.
Can I draw the flowchart instead of typing it?
Yes: draw it in the flowchart maker on this site, press Copy as Mermaid and paste the code here.
