Mermaid Diagram Preview & Flowchart Tester
Real-time Mermaid diagram Markdown viewer and previewer. Write diagram code in Markdown and preview flowcharts, sequence diagrams, class diagrams, Git graphs, and Gantt charts live — exactly as GitHub renders them.
Never Export a Diagram PNG Again
Traditional diagrams — Visio, draw.io, Lucidchart — produce binary files that drift out of sync with your code. Mermaid diagrams live in plain text alongside your documentation, diff cleanly in pull requests, and render natively on GitHub without any image uploads.
Diagrams as Code
Mermaid diagrams are plain text. They live in your repo, get code-reviewed in PRs, and never go stale because they are part of the codebase itself.
Native on GitHub
GitHub has rendered Mermaid natively since May 2022. Your diagrams display in READMEs, Issues, Wikis, and Discussions without any plugins.
Instant Client Render
All rendering happens in your browser using the Mermaid.js SVG engine. No server round-trips, no image hosting — diagrams update as you type.
Complete Mermaid Diagram Types Reference
Copy any snippet into the live editor above to preview the rendered diagram instantly.
Flowchart
Visualise processes, decision trees, and pipelines with directional graphs.
```mermaid
flowchart TD
A[Start] --> B{Is it working?}
B -- Yes --> C[Ship it!]
B -- No --> D[Debug]
D --> B
```Sequence Diagram
Show communication between participants over time — perfect for API and auth flows.
```mermaid sequenceDiagram participant Browser participant Server participant DB Browser->>Server: GET /api/user Server->>DB: SELECT * FROM users DB-->>Server: User row Server-->>Browser: 200 OK ```
Class Diagram
Model object-oriented relationships, inheritance, and interfaces in code design docs.
```mermaid
classDiagram
class Animal {
+String name
+int age
+speak() void
}
class Dog {
+fetch() void
}
Animal <|-- Dog
```Git Graph
Document branching strategies, release workflows, and git history in your project docs.
```mermaid gitGraph commit id: "Init" branch feature checkout feature commit id: "Add login" checkout main merge feature id: "Merge" commit id: "Release v1.0" ```
State Diagram
Map application states and transitions for UI flows, auth states, and finite state machines.
```mermaid stateDiagram-v2 [*] --> Idle Idle --> Loading : fetch() Loading --> Success : data received Loading --> Error : request failed Error --> Idle : retry Success --> [*] ```
Gantt Chart
Create project timelines, sprint plans, and milestone roadmaps directly in Markdown.
```mermaid gantt title Sprint Planning dateFormat YYYY-MM-DD section Backend API design :done, 2024-01-01, 3d Implementation :active, 2024-01-04, 5d section Frontend UI components :2024-01-03, 4d ```
Mermaid vs. PlantUML vs. draw.io
Compare diagram tool capabilities to choose the right tool for your documentation workflow.
| Feature | Mermaid | PlantUML | draw.io | MarkdownPreview.net |
|---|---|---|---|---|
| Flowcharts (flowchart TD/LR) | Live SVG render | |||
| Sequence Diagrams | Instant preview | |||
| Class Diagrams | Full v10 syntax | |||
| Git Graphs | Branch history | |||
| State Diagrams | v2 syntax | |||
| Gantt Charts | Date-format aware | |||
| GitHub native rendering | 1:1 GitHub output | |||
| Live 2-way editing | Markdown + HTML sync | |||
| Export clean HTML | One-click copy |
Common Mermaid Syntax Errors & Fixes
Most Mermaid render failures trace back to one of these four patterns.
```mermaid flow TD A --> B ```
```mermaid flowchart TD A --> B ```
The keyword must be exact: flowchart, sequenceDiagram, classDiagram, gitGraph, stateDiagram-v2, gantt, erDiagram.
A[Hello World (v2)] --> B
A["Hello World (v2)"] --> B
Node labels containing parentheses, colons, or other special characters must be wrapped in double quotes to avoid parse errors.
A["User & Admin"] --> B
A["User & Admin"] --> B
Do not use HTML entities inside Mermaid diagrams. Write literal characters — entities are treated as literal text.
dateFormat DD/MM/YYYY Task :2024-01-15, 3d
dateFormat YYYY-MM-DD Task :2024-01-15, 3d
The dateFormat declaration must exactly match the date format used in task definitions. Mismatches cause the entire Gantt chart to fail silently.
Frequently Asked Questions
Everything you need to know about Mermaid diagrams in Markdown.
Explore More Markdown Tools
All tools are free, client-side, and require no account.
Full CommonMark editor with real-time HTML preview, Mermaid, KaTeX, and one-click export.
Test GitHub READMEs, GFM alerts, task lists, and tables exactly as GitHub renders them.
Inline and block KaTeX equations, matrices, integrals, and aligned math — zero lag.
Practical tutorials: VS Code preview, GitHub rendering issues, browser workflows, and more.