What is a JSON Formatter & Validator?
A JSON formatter pretty-prints compact JSON into an indented, readable structure, and a validator pinpoints exactly where malformed JSON breaks, instead of a vague parser error at the end of a log.
Paste anything from an API response to a config file. Parsing happens locally with your browser’s native JSON engine, so even large payloads with secrets never leave your machine.
The validator is the quiet hero: APIs, config files and log pipelines fail on a single missing comma, and the error engines report ('Unexpected token at position 4823') is useless in a one-line blob. Formatting first, then reading the exact line and column of the failure, turns a ten-minute hunt into a five-second fix.
The mistakes that actually break JSON
Almost every parse failure is one of a small set, and they are all things JavaScript allows and JSON does not:
- A trailing comma after the last item in an object or array.
- Single quotes around strings or keys. JSON requires double quotes, on keys as well as values.
- Unquoted keys. Valid in a JavaScript object literal, illegal in JSON.
- Comments. JSON has none at all, which catches people moving a config from JSONC or JSON5.
- NaN, Infinity and undefined. None of the three is a JSON value, so a serializer that emitted them produced something no parser will read back.
- A byte order mark at the start of a file saved from a Windows editor, which makes the very first character invalid.
What the round trip quietly changes
Formatting parses your text and writes it back out, so the output is equivalent JSON rather than your bytes reindented. Four differences are worth knowing, because each has cost somebody a debugging afternoon:
- Duplicate keys collapse. If the same key appears twice, the last one wins and the earlier value disappears without a warning.
- Keys that look like integers are reordered. "1" and "2" sort ahead of named keys, because that is how object property order works, not a choice this tool makes.
- Very large numbers lose precision. Anything beyond about 9 quadrillion, which includes many 64-bit IDs and Twitter-style snowflake IDs, is rounded. Send those as strings.
- Negative zero becomes zero, and exponent notation is normalized, so 1e3 comes back as 1000.
Frequently asked questions
Why does my valid-looking JSON fail?
The usual suspects: trailing commas (allowed in JavaScript, illegal in JSON), single quotes instead of double, and unquoted keys. The validator points at the exact position of the first violation.
What indent size does the formatter use?
Two spaces: the dominant convention in web tooling. Minify reverses it to a single line for env vars and payloads.
Is my JSON sent to a server?
No: formatting and validation use the browser’s built-in parser. Payloads with tokens or customer data stay on your machine.
What does the validator actually check?
Strict JSON syntax (RFC 8259): quoting, commas, brackets and value types. It does not check against a schema.
Can it handle large files?
Yes: multi-megabyte JSON formats fine; the limit is your browser’s memory.
Why minify JSON?
Minified JSON strips whitespace to cut payload size: useful for embedding in configs, env vars or HTTP requests.