Format JSON online

Tool Output

About JSON formatter & validator tool

JSON formatter is an online tool which validates and pretty prints JSON data. Paste your JSON, click the button and instantly see whether the data is valid - and if it is, get it back neatly formatted.

The usage of this online tool is super easy. Just place the JSON data which should be formatted into the input textarea. Optionally choose the output format in more input options: pretty printed (the default) or compact (minified, all on one line). Tick sort object keys alphabetically when you need object keys in order. Next, click on format JSON button. Finally, you can see your formatted JSON in the output textarea - or an error message which tells you what is wrong with the data.

How JSON formatting works?
The tool first parses the data with a strict JSON parser. If the parser finds a mistake - a missing comma, a stray bracket or an unquoted key - it reports the exact problem. Valid data is then re-serialised with consistent indentation and line breaks, so the structure is easy to read and review.

Formatting is also a quick way to validate JSON before you paste it into a configuration file, an API request or a database record. Unicode characters are kept exactly as you typed them.

Handy for checking JSON produced by scripts, APIs and configuration files before it goes live.

Related Tools