JSON Formatter
Beautify, minify and validate JSON — and when it is broken, get the exact line and column of the problem.
Input
Waiting for input.
Output
About this JSON formatter
This tool parses your text with the browser's own JSON.parse, which implements the strict grammar of RFC 8259. If the document is valid it is re-serialised with the indentation you choose, or compacted to a single line with all optional whitespace removed. Validation and formatting are therefore the same operation: a document that formats is a document that parses.
When parsing fails, JavaScript reports a character offset rather than a position a human can act on. This tool converts that offset into a line and column number and shows the offending line with a caret under the exact character. That matters for minified payloads where the whole document is one enormous line and a raw offset is useless.
Two limits are worth stating plainly. First, this is strict JSON, not JSON5 or JSONC: comments (//, /* */), trailing commas and unquoted keys are rejected, because those are extensions and not part of the format. Second, all numbers are handled as IEEE-754 doubles, so integers beyond 253 lose precision on the round trip — keep identifiers that large as strings.
Related tools
Found a bug, or need a tool that is not here? Email 2273917172@qq.com — a human reads every message.