How to Create Diagrams With Mermaid in 5 Minutes
Mermaid is a free, open-source JavaScript library that renders diagrams from plain text — flowcharts, sequence diagrams, class diagrams and Gantt charts. You write a few lines of syntax, and it draws the picture. There is no dragging boxes around and no account to create.
The catch most people hit early: Mermaid is a tool, not a website. You need somewhere to run it. Below is the fastest path, plus the versions and limits worth knowing in 2026.
What is Mermaid and what does it actually do?
Mermaid is a text-to-diagram renderer. You write code like A --> B and it produces a clean SVG. It powers diagram blocks in GitHub, Notion, Obsidian, GitLab, and the official Mermaid Live Editor. Because output is SVG, the diagrams stay sharp at any zoom level and can be committed to Git alongside your code.
It supports around 15 diagram types today. The ones you will use most: flowchart, sequence, class, state, ER, pie, and gantt.
How do I render my first Mermaid diagram?
The Mermaid Live Editor is the fastest option — open it in a browser, paste, done.
- Go to the Mermaid Live Editor (mermaid.live).
- Paste this in the left pane:
flowchart TD
A[Start] --> B{Logged in?}
B -- Yes --> C[Show dashboard]
B -- No --> D[Show login]
D --> A
3. Watch the right pane render instantly. Switch to the Code tab to copy the SVG or PNG for a doc. The whole thing takes about 90 seconds once you know where to click.
Is Mermaid free to use?
Yes. Mermaid is released under the MIT license and costs nothing, even commercially. The Live Editor is hosted free by the maintainers. The only real cost is your time learning the syntax — and that is small compared to drawing tools.
How do I embed Mermaid in Markdown or GitHub?
GitHub, GitLab, Notion and Obsidian all render Mermaid natively. Wrap the syntax in a fenced block tagged mermaid:
```mermaid
sequenceDiagram
Alice->>Bob: Deploy to prod
Bob-->>Alice: Done in 4m
```
On GitHub, this renders on save. Same for GitLab and Notion. Obsidian needs the file saved as .md and the diagram block recognized — it works out of the box in current versions.
Where does Mermaid fall short?
Auto-layout is Mermaid’s weak spot. Complex graphs with 30+ nodes often produce tangled lines, and there is no drag-to-reposition — you fight the layout with invisible spacing hacks. If you need pixel-perfect control, a canvas tool fits better.
Best for: engineers documenting architecture, teams keeping diagrams in Git, and anyone who wants version control on their visuals. Not for: marketing decks that need custom branding and manual placement.
Quick Summary
- Mermaid renders flowcharts, sequence diagrams and Gantt charts from plain text; MIT-licensed and free.
- The fastest start is mermaid.live — paste code, copy the SVG.
- GitHub, GitLab, Notion and Obsidian render it natively with a “`mermaid fence.
- Weakness: automatic layout gets messy past ~30 nodes; no manual repositioning.
