JSON formatter and validator

Paste JSON, format it or compact it, with the exact location of the first syntax error.

JSON to process
Result

JSON formatter is a free tool that runs entirely in your browser, with no data ever sent to a server. Format, minify and validate JSON, with the exact line and column of each error.

Format, minify, validate

JSON pulled from an API or a config file often arrives on a single, unreadable line. Formatting it adds regular indentation that makes the structure instantly scannable. Minifying does the opposite, stripping every extra space, useful for shrinking a file before sending it.

Spotting a syntax error

An extra comma, an unquoted key, or a missing brace are the most common mistakes. The tool reports the exact line and column where parsing stops, so you don't have to read the whole document by hand.

What this tool does not do

This tool only performs the calculation described above, without checking how you intend to use the result. There is no limit set by the tool itself : the only constraint is your device's memory.

Frequently asked questions

Why does sorting keys change the order?

By default, a JSON object keeps the order its keys were written in. Sorting them makes two documents easier to compare, at the cost of losing that original order.

Are very large numbers kept exactly?

As in any JavaScript engine, numbers beyond about 9,007,199,254,740,991 lose their exact precision. For an identifier that large, it's safer to store it as text in the original JSON.

Is my data sent to a server?

No : the text you type or paste is processed entirely in your browser, on your device. It is never transmitted to a server.