How to draw a JSON graph
- Paste your JSON, drop a file on the box, or press Example.
- The graph is drawn as you type. Drag to move around and scroll to zoom. Fit shows the whole graph again.
- Press − next to a row to fold that branch, or + to open it. The number tells you how many boxes are hidden.
- Click a box to see its path, such as
$.services[0].env, then press Copy path. - Press SVG or PNG to save the graph as it is drawn on screen.
How the graph is built
- Each object or list becomes a box. Plain values are rows inside the box.
- A row that holds an object or list shows its size, such as
{3 keys}or[12 items], and links to the box for it. - A list of objects fans out into one box per item. Each link is labelled with its place, such as
services[0]. - A list of plain values stays in one box.
- Choose Left to right for deep documents or Top to bottom for wide lists of records.
Limits
The graph draws up to 1,500 boxes at a time, and a box lists up to 200 rows. Large documents open partly folded, so the first view stays readable. Long values are shortened in the box; point at a row to see more. Values keep their original spelling, so large numbers are not rounded. Use the JSON formatter Tree view to read every value of a very large file.
Example
Made-up input, and what JSON Graph Viewer returns for it. Long text is shortened.
{
"project": "demo-shop",
"version": "2.1.0",
"private": true,
"owner": {
"name": "Demo User",
"team": "Web"
},
"services": [
{
"name": "api",
"port": 8080,
"replicas": 2,
"env": {
"LOG_LEVEL": "info",
"CACHE": true
}
},
{
"name": "web",
"port": 80,
"replicas": 3,
…{
"project": "demo-shop",
"version": "2.1.0",
"private": true,
"owner": {
"name": "Demo User",
"team": "Web"
},
"services": [
{
"name": "api",
"port": 8080,
"replicas": 2,
"env": {
"LOG_LEVEL": "info",
"CACHE": true
}
},
{
"name": "web",
"port": 80,
"replicas": 3,
…Questions
Is my JSON uploaded?
No. The graph is drawn in your browser, and the editor cannot send requests.
What is in the saved picture?
The boxes and links as they are drawn, with folded branches left out, in the current light or dark theme.
Can it draw XML?
No. The graph is for JSON. Use the XML formatter Tree view for XML.