mygems

View JSON as a tree or a graph

The shape of a JSON document, before you read a line of it.

  • Tree and graph views
  • Search keys and values
  • Copy the JSONPath
  • Nothing uploaded

1.Paste JSON, or open a file

JSON or GeoJSON. Drag it here, or choose a file.

Why it exists

Pretty-printed JSON is still a wall of text once it runs past a screen. What you usually want first is the shape: what is nested in what, which arrays hold objects, where the field you are looking for lives. A tree answers that by folding away what you are not reading, and a graph answers it at a glance. This shows both, from the same document, without sending it anywhere.

What it does

  • Shows the document as a collapsible tree with a key or item count on every object and array.
  • Draws it as a graph: one box per object or array, its fields inside, and a line to everything nested in it.
  • Searches keys and values, and opens the tree just far enough to show every match.
  • Gives the JSONPath of whatever you click, ready to copy into code or a query.
  • Keeps numbers exactly as written, so long IDs are not rounded for display.

What it does not do

It reads; it does not edit. Change a value in the tree or the graph and you would want the text to change with it, and keeping three views of one document in step is an editor's job rather than a viewer's. Very large documents are shown as a tree only, because a graph of thousands of boxes is no longer something anyone can read.

Questions

Is my JSON uploaded?
No. It is parsed and drawn by code running inside the page. There is no server behind this tool, so there is nowhere for the document to go.
What if my JSON is invalid?
The viewer says where it stops being valid, by line and column, and links to the JSON formatter, which can fix comments, trailing commas, single quotes and unquoted keys in one click.
How large a document can it show?
The tree handles files of tens of megabytes on a desktop browser, listing large arrays a couple of hundred items at a time. The graph is drawn for documents with up to 1,500 objects and arrays.