Generate Mermaid Diagrams from JSON
Turn any JSON structure into flowcharts, class diagrams, mind maps, Gantt charts, and more using the JSON to Mermaid tool.
Last updated:
Mermaid diagrams are a great way to communicate data structures, timelines, and relationships in documentation, wikis, and README files. DataLensia can generate them automatically from any JSON input โ no diagram syntax knowledge required.
๐ฉ The Scenario
You have a JSON API response documenting a project structure:
{
"project": "DataLensia",
"phases": [
{ "name": "Research", "start": "2025-01-01", "end": "2025-01-15", "status": "done" },
{ "name": "Design", "start": "2025-01-16", "end": "2025-02-01", "status": "done" },
{ "name": "Development", "start": "2025-02-02", "end": "2025-04-01", "status": "active" },
{ "name": "Launch", "start": "2025-04-15", "end": "2025-04-30", "status": "pending" }
]
}
You want a Gantt chart and a flowchart for your documentation.
๐ ๏ธ Step-by-Step
- Open the Mermaid Visualizer.
- Paste your JSON into the left panel.
- Select a Diagram Type from the top selector.
- The diagram renders live in the right panel.
- Adjust settings like direction, depth limit, and theme.
- Click Export to download as SVG or PNG.
๐ Diagram Types Reference
| Diagram | Best For | Key Setting |
|---|---|---|
| Flowchart | Hierarchical structure, navigation maps | Direction: TD / LR |
| Class Diagram | Object types and properties | Depth limit |
| Mind Map | Exploring nested hierarchies at a glance | Depth limit |
| ER Diagram | Relationships between entities | โ |
| Sequence Diagram | Interaction flows between actors | โ |
| Gantt Chart | Project phases with dates | Date fields |
| Timeline | Chronological events | Date fields |
| Pie Chart | Numeric distributions | Value field |
| State Diagram | Status transitions | โ |
| User Journey | UX flows with satisfaction scores | Score field |
๐๏ธ Diagram Settings
Direction (for Flowchart):
TDโ Top-Down (default)LRโ Left-Right (better for wide trees)RLโ Right-LeftBTโ Bottom-Top
Depth Limit: Controls how many levels of nesting to include. Useful for very deep JSON โ start at depth 3 and increase if needed.
Theme: Match your documentation's style โ default, dark, forest, neutral.
๐ Using Mermaid in Documentation
The generated Mermaid syntax can be copied and pasted directly into:
- GitHub Markdown โ GitHub renders Mermaid in
.mdfiles natively. - Notion โ Use the
/mermaidblock. - Obsidian โ Supports Mermaid in code blocks.
- Confluence โ With the Mermaid plugin.
- Any Markdown renderer that supports Mermaid.
Example output for the project JSON above (Gantt):
```mermaid
gantt
title DataLensia Project
dateFormat YYYY-MM-DD
section Phases
Research :done, 2025-01-01, 2025-01-15
Design :done, 2025-01-16, 2025-02-01
Development :active, 2025-02-02, 2025-04-01
Launch : 2025-04-15, 2025-04-30
```
๐ก Tips for Better Diagrams
- Too many nodes? Reduce the depth limit or filter your JSON first with the Transform Builder to keep only relevant fields.
- SVG vs PNG: Use SVG for documentation (scales perfectly), PNG for presentations and slides.
- Class diagrams work best on flat objects where each key has a defined type โ not deeply nested arrays.
- Mind maps are ideal for exploring an unfamiliar API response at a high level.
๐ Combine with Flow Diagram
For interactive exploration (zooming, panning, searching nodes), use the Flow Diagram instead. For static documentation export, Mermaid is the better choice.
๐ Try it now
Paste any JSON into the Mermaid Visualizer and select Mind Map for an instant overview of its structure.