What is Mermaid?
Mermaid is a text-based diagram language. Describe who connects to whom and the layout is done for you, so editing a diagram is as easy as editing text.
A free online Mermaid editor and viewer. Type Mermaid code on the left and the chart renders live on the right: flowcharts, sequence diagrams, ER diagrams, Gantt charts and more. Export Mermaid to PNG or SVG in one click. No sign-up.
Got a Mermaid chart in a README, a pull request or an AI answer? Paste the code into the editor above to view it instantly. The Mermaid renderer redraws the preview as you type, so you can tweak labels and arrows and see the result right away.
Mermaid is a text-based diagram language. Describe who connects to whom and the layout is done for you, so editing a diagram is as easy as editing text.
Code you write here works anywhere Mermaid is supported, including GitHub, GitLab and most Markdown editors.
flowchart TD (top to bottom) or flowchart LR (left to right).A[Start]. The brackets set the shape.-->, and label an arrow with -- Yes -->.flowchart LR
A[Box] --> B(Rounded)
B --> C{Decision}
C -- Yes --> D((Circle))
C -. No .-> E[[Subroutine]]
subgraph Group
D --> F[(Database)]
end
Sequence diagrams show how systems talk to each other over time. List the participants, then write one message per line:
->> draws a solid arrow for a request and -->> a dashed arrow for a reply.
Load the Sequence example above to edit this diagram live, or try an ER diagram for database tables.
sequenceDiagram
participant User
participant Server
User->>Server: Send login request
Server-->>User: Return token
User->>Server: Request data with token
Server-->>User: Return data
The first line picks the diagram type. These are the forms you will use most.
| Diagram | First line | Common syntax |
|---|---|---|
| Flowchart | flowchart TD | A[Text] --> B{Decision} A -.-> B A ==> B |
| Sequence diagram | sequenceDiagram | User->>Server: request Server-->>User: reply |
| Class diagram | classDiagram | Animal <|-- Dog +eat() |
| State diagram | stateDiagram-v2 | [*] --> Draft Draft --> Published: approve |
| ER diagram | erDiagram | CUSTOMER ||--o{ ORDER : places |
| Gantt chart | gantt | dateFormat YYYY-MM-DD Task :a1, 2026-01-05, 5d |
| Pie chart | pie title Title | "Search" : 45 |
| Mindmap | mindmap | Indentation sets the level, root((Center)) |
| Result | Syntax |
|---|---|
| Box / rounded box | A[Text] A(Text) |
| Diamond (decision) | A{Text} |
| Circle / database | A((Text)) A[(Text)] |
| Solid / dotted / thick arrow | --> -.-> ==> |
| Arrow with a label | A -- text --> B or A -->|text| B |
| Group (subgraph) | subgraph Name … end |
| Comment | %% this line is not drawn |
Turn any Mermaid chart into an image for slides, docs, tickets or chat.
```mermaid code block
Writing docs? In the MarkdownEdit Markdown editor, add a ```mermaid code block and the diagram previews
right next to your text. Export the whole document to PDF, Word or HTML with the diagrams included.
## Release flow
```mermaid
flowchart LR
Write --> Review --> Publish
```
Mermaid is a text-based diagram language. You describe a flowchart, sequence diagram or Gantt chart in a few lines of code and Mermaid draws it for you. It is open source, and GitHub, GitLab and many Markdown editors render Mermaid diagrams natively.
Yes. It is free and needs no account. Diagrams are rendered in your browser.
Once the diagram renders, click Download PNG below the preview. The PNG is exported at 2x resolution on a white background. Click Download SVG instead if you need a vector file that stays sharp at any size.
Flowcharts (flowchart), sequence diagrams (sequenceDiagram), class diagrams (classDiagram), state diagrams (stateDiagram-v2), ER diagrams (erDiagram), Gantt charts (gantt), pie charts (pie) and mindmaps (mindmap). The buttons above the editor load a working example of each.
No. MarkdownEdit is an independent tool built on the open-source Mermaid library and is not affiliated with the Mermaid project. Diagrams use standard Mermaid syntax, so code you write here works anywhere Mermaid is supported.
Yes, it is saved automatically in your browser's local storage, so it is still there after a reload. It is not uploaded to a server, except when you click Generate with AI or Fix with AI: then your description or code is sent through our server to the DeepSeek model for processing. Copy it somewhere safe before switching devices.