Developer tools

JSON formatter and viewer

Format, minify and validate JSON, then explore it as a graph of boxes or a collapsible tree.

Runs in your browser. Nothing you enter is uploaded.

Output

Graph

Drag to move, scroll or pinch to zoom.

Tree

About this tool

The JSON formatter validates JSON, then pretty-prints it with 2 or 4 spaces or tabs, or minifies it to one line. The result can also be explored as a graph of boxes or a collapsible tree. On invalid input it shows the browser’s parse error, which usually names the position where the JSON breaks.

Does it accept comments or trailing commas?
No. The input is parsed as strict JSON, so comments, trailing commas and single-quoted strings are reported as errors.
Why did a large number change after formatting?
Numbers are read as JavaScript numbers, which lose precision above 2^53, so a long numeric ID can come back rounded. Keep such IDs as strings in the JSON.