EN

JSON Formatter

Format, validate and minify JSON. Syntax errors are reported with the exact line and column.

FAQ

How do I find where my JSON is broken?

Click Validate: it reports the error type together with line and column. Usual culprits are trailing commas, missing quotes and unbalanced brackets.

Does formatting change my data?

No. Only indentation and line breaks change; values are untouched.

Is my JSON uploaded?

No. Parsing runs entirely in your browser and works offline.

About this tool

All three actions share one parser: Format re-indents with 2 spaces, 4 spaces or a tab, Minify removes every whitespace character, and Validate only reports whether the input is valid. None of them changes your data — number precision, string escapes and the original key order are preserved.

When validation fails you get the line and column, not just "invalid JSON". The browser's own message carries a character offset only (position 42), which leaves you counting to the 42nd character; here the offset is converted to a line and column, and the engine's reason is kept (for example Expected double-quoted property name) so you can tell a missing quote from a trailing comma or an unbalanced bracket. Line numbers are counted against the exact text you pasted, so leading blank lines do not shift them.

A few JSON rules cause most false alarms, and the error comes from the format rather than the tool: trailing commas are invalid ({"a":1,} fails, unlike a JavaScript object literal), comments are not allowed, keys must use double quotes (single quotes fail), and undefined / NaN / Infinity must not appear. Many "JSON won't parse" reports are really JavaScript object literals being passed as JSON.

Parsing happens entirely in your browser: nothing is uploaded and it works offline, so it is safe for API responses, keys or phone numbers that should not pass through a third-party server.