JSON to Mermaid
Visualize JSON structures as 13 different diagram types using Mermaid.js — flowcharts, mind maps, ER diagrams, Gantt charts, and more.
Last updated:
The JSON to Mermaid tool turns abstract data into beautiful, human-readable diagrams. It's perfect for documenting API structures, state machines, project timelines, or organizational charts stored in JSON.

📊 Supported Diagram Types (13)
| Diagram | Best For |
|---|---|
| Flowchart | Hierarchical structure with nodes and edges |
| Class Diagram | Object properties as class diagrams |
| Mind Map | Radial tree layout for JSON hierarchies |
| ER Diagram | Entity-relationship for nested objects |
| Architecture | High-level topology and adjacency lists |
| Schema View | Inferred fields and types from JSON objects |
| Compact View | Dense hierarchical structures |
| Sequence Diagram | Interaction between objects over time |
| Pie Chart | Numerical distribution of data |
| Timeline | Chronological events and dates |
| State Diagram | States and transitions in a process |
| Gantt Chart | Project schedules and dependencies |
| User Journey | Steps, scores, and user experiences |
⚙️ Configuration Options
- Direction: Top-Down, Left-Right, Bottom-Up, Right-Left.
- Curve Style: Basis (rounded), Linear, Step.
- Max Depth: Control how deep into nested structures the diagram goes.
- Max Items: Limit items per branch (or records for sequence, timeline and similar views).
- Date Format: Configure date formatting for Gantt charts (YYYY-MM-DD, DD/MM/YYYY, MM/DD/YYYY).
Inferring schemas from heterogeneous arrays
Class Diagram, Schema View and ER Diagram infer a shared model from the object records in each array. For example, [{"id":1},{"id":"external","extra":true}] gives id the types number|string and makes extra optional. Optional fields use ? (or optional in ER); missing fields and null are distinct. Different paths have separate models, root arrays share one record model, and empty arrays remain unknown[] until there is evidence about their contents.
Arrays are sampled evenly, up to 1,000 elements each. The collapsed How this diagram was inferred notice reports sampling and limits; variants outside the sample may be missing. Mermaid code exports include coverage comments. SVG/PNG contain the diagram only, so share the notice too when sample coverage matters.
Class/ER cardinalities distinguish single objects from collections and describe JSON containment, not database rules. ER labels stay concise; observed counts are in the inference details. Inference runs in a cancellable worker, while document statistics cover the full JSON. Where supported, Max Items limits displayed properties independently of sampling. Depth and capacity limits mark the diagram as partial; default output limits are 500 nodes, 500 edges and 2,000 fields. The original JSON is preserved.
✨ Features
- Live Preview: The diagram updates instantly as you edit the JSON or change settings.
- Stateless Sharing: Generate compressed links to share your exact JSON and diagram configuration with others.
- SVG Export: Download your diagrams as high-quality vector images.
- PNG Export: Export as raster images for presentations and documentation.
- Fullscreen Mode: Work in a distraction-free view for complex diagrams.
- Zoom & Pan: Navigate large diagrams with smooth controls.
- Dark/Light Themes: Diagrams adapt to your preferred color scheme.
- Code Preview: See and copy the raw Mermaid syntax for embedding in GitHub, Notion, or Confluence.
🛠️ How to Use
- Open the Mermaid Visualizer.
- Paste your JSON into the editor (or upload a file).
- Select the diagram type from the top selector.
- Adjust configuration settings (direction, depth, items).
- Preview the result in real-time.
- Share your work using the Share (🔗) button.
- Export as SVG, PNG, or copy the Mermaid code.
🚀 Try it now
Open the Mermaid Visualizer and paste an object to see it come to life.