JSON Formatter & Validator
Paste JSON to reformat, minify or validate it. Errors are reported with the line and column where parsing failed, which is usually a few characters before where you think the problem is.
JSON Input
Everything runs in your browser — the text never leaves your device.
The five things that break JSON
Almost every invalid JSON document fails for one of the same handful of reasons. Trailing commas after the last element — legal in JavaScript, illegal in JSON. Single quotes instead of double quotes. Unquoted keys, which JavaScript object literals allow but JSON does not. Comments, which JSON has never supported. And unescaped control characters or raw line breaks inside strings.
The error message tells you where the parser gave up, which is not always where the mistake is. A missing closing brace early in a large document often reports an error at the very last character, because everything until then was still potentially valid.
Why this runs entirely in your browser
JSON payloads routinely contain API keys, customer records, internal identifiers and access tokens. Pasting those into a tool that posts them to a server is a data-handling incident waiting to happen, and a surprising number of online formatters do exactly that. This page parses with the browser's own built-in JSON engine — nothing is transmitted, and the page works with the network disconnected.
Minifying is not compression
Stripping whitespace typically cuts a formatted document by twenty to forty percent, which looks impressive until you remember that gzip or brotli on the wire would have removed most of that anyway. Minify JSON for embedding in a file or a database column where transport compression does not apply; do not bother for API responses that are already compressed in transit.
Sorting keys
JSON objects are formally unordered, so sorting keys alphabetically changes nothing semantically. It is enormously useful when you are diffing two documents that were generated by different systems, since it removes the noise of arbitrary key ordering and leaves only real differences.