JSON Formatter and Validator
Indent unreadable JSON, or collapse it back to a single line. Invalid JSON is reported with the position of the problem rather than a bare failure.
Java, Python, C, C++, C#, PHP, Swift, Kotlin, Objective-C and Protobuf are not listed. Their formatters are native programs with no browser build, so supporting them would mean uploading your code to a server — which this site does not do.
How to use it
- Paste your JSON into the input pane.
- Select Format to indent it, or Minify to strip whitespace.
- Copy or download the result.
Questions
Does it validate as well as format? Yes — formatting requires parsing, so anything that formats is valid JSON. If it does not, you get the parser’s own message naming the position of the problem, which is usually enough to find a stray comma.
Are keys reordered? No. The original order is kept, which matters when you are comparing two files by eye.
Is my JSON uploaded? No. It is parsed in your browser. This matters more for JSON than most formats — API responses and config files routinely contain tokens, personal data and internal hostnames.
Why are arrays expanded onto separate lines? That is what JSON.stringify does when indenting, and matching the language’s own output means the result is exactly what your code would produce.