Navigation

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.

JSON to Mermaid Visualizer

📊 Supported Diagram Types (13)

DiagramBest For
FlowchartHierarchical structure with nodes and edges
Class DiagramObject properties as class diagrams
Mind MapRadial tree layout for JSON hierarchies
ER DiagramEntity-relationship for nested objects
ArchitectureHigh-level topology and adjacency lists
Schema ViewInferred fields and types from JSON objects
Compact ViewDense hierarchical structures
Sequence DiagramInteraction between objects over time
Pie ChartNumerical distribution of data
TimelineChronological events and dates
State DiagramStates and transitions in a process
Gantt ChartProject schedules and dependencies
User JourneySteps, 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

  1. Open the Mermaid Visualizer.
  2. Paste your JSON into the editor (or upload a file).
  3. Select the diagram type from the top selector.
  4. Adjust configuration settings (direction, depth, items).
  5. Preview the result in real-time.
  6. Share your work using the Share (🔗) button.
  7. 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.