Tools / JSON Formatter

JSON Formatter & Validator

Paste messy JSON and get it back readable, or minified for shipping. Errors are reported with the line and column where parsing stopped, plus what the parser expected instead.

Ad slot — responsive display unit
Indent
Input
Output
Size
Keys
Depth
Arrays
Saved by minify
Ad slot — in-content unit

The errors that break JSON most often

JSON is a deliberately strict format, and almost every parse failure comes down to one of a handful of things. Knowing them turns a cryptic error into a two-second fix.

Format or minify — when to use each

Formatting adds indentation and line breaks so a human can read the structure. Minifying strips every unnecessary byte of whitespace. Neither changes the data, so you can move between them freely.

For anything travelling over a network — API responses, config bundled into a page, data stored in a field — minify. The saving is usually 15–30% on structured data, and it costs nothing since machines do not care about indentation. Keep formatted JSON for files a person will open and edit, and let your version control system deal with the extra lines.

What escape and unescape do

Escaping turns your JSON into a single string value, with quotes and backslashes protected. This is what you need when JSON has to be embedded inside another JSON document, pasted into a string field, or passed as a command line argument. Unescape reverses it, which is the fastest way to read a nested payload someone has handed you as an opaque string.

Sorting keys

JSON objects have no guaranteed order, so sorting keys alphabetically is safe and does not change meaning. It is genuinely useful when you need to compare two documents that contain the same data in different orders — sort both, and a plain text diff becomes readable.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser. This matters for JSON containing API keys, tokens or customer data — none of it leaves your machine.

Will it handle very large files?

Files up to a few megabytes format quickly. Beyond that the browser may pause while parsing, since the whole document is held in memory at once.

Can it fix broken JSON automatically?

No, and deliberately so. Guessing at what a malformed document meant risks silently changing your data. The error message tells you where parsing stopped so you can decide yourself.

Does it support JSON Lines or JSON5?

Not currently. This validates against the standard JSON specification, so comments, trailing commas and unquoted keys are reported as errors rather than accepted.