At One Place

JSON formatter and validator

Pretty-print, minify and validate JSON, with the exact position of any error.

How it works

Formats JSON with indentation, minifies it back down, and validates it. When parsing fails, the error message and the position in the input are both reported, which is usually enough to find the problem immediately.

The errors that account for most failures are all things JSON forbids and JavaScript allows: trailing commas after the last element, single quotes instead of double, unquoted keys, and comments. JSON has none of these. A file that works when pasted into JavaScript can still be invalid JSON.

Everything runs in your browser, so it is safe to paste a payload containing keys or personal data.

This tool runs entirely in your browser. Nothing you enter is sent to a server, logged or stored, and the page keeps working with the network disconnected.

Common questions

Why is my JSON invalid when it looks fine?
Usually a trailing comma, single quotes instead of double quotes, unquoted keys, or a comment. JSON permits none of those, though JavaScript does.
Are comments allowed in JSON?
No. The specification has no comment syntax. Formats like JSON5 and JSONC add them, but standard parsers reject them.

Related pages