JSON Formatter

Readable JSON, and the line that broke it.

Paste it in to format or minify. If it won't parse, you get the reason — and the line and column wherever your browser can pinpoint it.

Parsed by your browser's own JSON engine. Nothing is uploaded — safe for data you would not paste into a random website.

Why valid JavaScript isn't always valid JSON

JSON looks like a JavaScript object, which is exactly why it trips people up. JSON is stricter: keys must be in double quotes, strings must use double quotes rather than single, and a trailing comma after the last item — perfectly fine in modern JavaScript — is a syntax error.

Those three rules account for most of the errors this tool reports, and for all of them your browser can name the exact line and column, so you can go straight to the character that broke it. A few rarer token errors can't be pinned to a position — in those cases you get the browser's own message with the offending snippet quoted, rather than a made-up line number.

Format or minify

Format re-indents the data with two spaces per level, which is what you want while reading or debugging. Minify strips every space and newline outside of strings, producing the smallest valid version — useful when the JSON is going over a network and size matters. Both confirm the JSON is valid as a side effect.

Common questions

What are the most common JSON syntax errors?

A trailing comma after the last item, single quotes instead of double quotes, unquoted keys, and missing closing braces or brackets. JSON is stricter than JavaScript object syntax, so valid JavaScript is not always valid JSON.

What does minifying do?

It strips every space, tab and newline that is not inside a string, producing the smallest valid version of the same data. Useful for reducing payload size when sending JSON over a network.

Is my JSON sent to a server?

No. Parsing and formatting happen entirely in your browser using the built-in JSON parser. Nothing is uploaded, logged or stored, which matters if the data contains anything sensitive.

The other tools