json→json

JSON Formatter & Validator

Format, validate, and minify JSON, with the exact line and column of any syntax error.

By opening this website or using its tools, you agree to our Terms and Privacy Policy.

Indent
Network activity during processing
0 bytes uploaded

Your file never leaves your browser during processing

How it works

To format JSON, paste it above — it is validated and pretty-printed instantly in your browser, with a specific line and column pointing at any syntax error, and options to sort keys or minify instead.

JSON is parsed and re-serialized using the browser’s native JSON.parse and JSON.stringify — the same JSON engine every JavaScript environment uses, so the validation is exact rather than an approximation. A file that parses here will parse identically wherever else it gets consumed.

When the input isn’t valid JSON, the browser’s error message only reports a raw character offset, which is not very useful for finding the problem in a large file. This tool walks that offset back into a line and column number, so "Unexpected token } in JSON at position 142" becomes something you can actually locate in the input.

Sort keys recursively reorders every object’s keys alphabetically, useful for diffing two JSON files that differ only in key order. Minify strips all whitespace to produce the smallest valid representation — the inverse of formatting, for when the output is going into a request body rather than being read by a person.

FAQ

Why does the error message include a line and column?

JSON.parse only reports a character position in its error message. This tool converts that position into a line and column by counting newlines in the input, so you can find the problem faster in a large file.

Does this convert between JSON and other formats?

No — this tool only formats and validates JSON, keeping it as JSON. For converting between JSON, CSV, and Excel, see the Excel ↔ CSV ↔ JSON converter (planned for a later phase).

What does "sort keys" do to arrays?

Nothing — array order is preserved exactly. Only object keys are reordered, recursively through the whole structure.

Related tools