JSON Formatter
Pretty-print JSON with 2 or 4 space indentation, minify it for production, sort keys alphabetically, and pinpoint syntax errors down to the line and column.
0 characters
Everything runs in your browser. Your text is not uploaded for processing and never leaves this device.
Frequently asked questions
How does the error position work?
The parser reads your JSON character by character, so when something is wrong it reports the exact line and column, plus what it expected to find, instead of a vague browser message.
What does Sort keys do?
It reorders every object's keys alphabetically, at every nesting level. That makes two documents easy to compare, and it never changes arrays or values.
Is formatting the same as validating?
Here, yes: the tool fully parses the document before formatting, so output only appears when the JSON is valid. Invalid input shows an error and no partial output.