Skip to main content

JSON Viewer and Formatter

Validates JSON, shows the exact position of an error, formats or minifies it, and opens it as a tree.

Runs in your browser. The file or text you give it is not uploaded. Free, no account.

How it works

An API call came back and something in the payload is wrong. Paste the JSON here: if it does not parse, you get the line and column of the first error and what was expected at that point. If it does parse, format it, minify it, or open it as a tree and copy any value's path.

  1. 1

    Paste JSON. If it is invalid you get the line and column of the first error and what was expected there.

  2. 2

    Valid JSON can be formatted with 2 or 4 spaces, minified, or explored as a collapsible tree with a count on every object and array.

  3. 3

    Click a value in the tree to copy its path.

What it does not do

  • Strict JSON only: comments and trailing commas are errors, as the specification says.

  • Very large files (over about 20 MB) can make the tree slow.

When a source is busy or a site does not answer, this tool says so. It never fills the gap with a guess.

Questions

Why is my JSON invalid when a trailing comma looks fine?

Comments and trailing commas are not part of the JSON specification, so a strict parser rejects them. Many editors accept them as a convenience, which is why the file works in one place and not here. Delete the comment or the trailing comma and paste again; the error line and column point straight at it.

What does the error position tell me?

It means the parser reached a character that cannot appear where it is. The line and column point at that character, and the message names what the parser expected instead: a comma, a closing bracket, a colon or a value. Read the character before that position, since a missing comma or quote usually starts there.

Why is the tree slow on a large file?

The tree builds a node for every object, array and value, and on a very large file that gets slow. The tool runs in your browser, so your data stays on your machine. For a file that size, validate or minify it first, and expand only the branches you need.