JSON Formatter

Reindent, minify and validate JSON, with the parse error pointed at the line and column that broke it.

Applies when formatting, ignored when minifying.

Key order

Useful for diffing two payloads that differ only in order.

Output

      

On the error messages

Browsers report a JSON parse failure as a character offset, which is useless when you are staring at 400 lines. This tool converts that offset into a line and column number and prints the offending line, which is almost always enough to spot the trailing comma or the unquoted key.

Sorting keys mutates the document order but nothing else. JSON objects have no defined order, so this is safe for comparison, though do not use the sorted output where a signature was computed over the original bytes.