WebTools

Format and validate JSON

Indent, minify or sort keys, and get the error’s line and column.

Indent, minify or sort the keys of a JSON document, and when it is invalid get the line, the column and what was expected there.

The browser engine no longer says where it failed, so when JSON does not parse the page walks it again with its own analyser, which can: “a comma too many before }”, “expected a key name in double quotes”, always with the exact position.

How to use it

  1. Paste the JSON, however messy.
  2. Choose indented, minified or key-sorted output.
  3. Copy the result.

Frequently asked questions

What is sorting the keys for?
For comparing two JSON documents that hold the same content in a different order. Once both are sorted, a text diff shows only the real differences.
Is the file uploaded anywhere?
No. Everything happens inside the tab, which matters when the JSON you paste holds API keys or customer data.
Does it accept JSON with comments or trailing commas?
No, and it will tell you exactly where. That is not standard JSON, even though some configuration files allow it.

Related tools