JSON Formatter & Validator

Format messy JSON into readable indentation, minify it, and get a clear error when it is invalid.

JSON

Formatted

What this tool does

Re-indents JSON so you can read it, minifies it when you need it small, and tells you exactly where the syntax breaks when it won't parse. Output updates as you type.

Why JSON fails to parse

JSON is stricter than JavaScript object literals, which is where most confusion comes from. The usual causes are a trailing comma after the last element, single quotes instead of double, unquoted keys, or a // comment. All four are perfectly legal JavaScript and all four are invalid JSON.

Formatting versus minifying

  • Formatted JSON adds indentation and newlines. It's for reading and diffing.
  • Minified JSON strips every optional byte. It's for transmitting and storing.
  • Both parse to identical data. Whitespace outside of strings carries no meaning in JSON.

One caveat about numbers

JSON numbers larger than JavaScript's safe integer range (253−1) lose precision when parsed, so a very large ID may come back subtly different. This affects every JavaScript-based JSON tool, including your browser's own JSON.parse. If you work with such IDs, transmit them as strings.

FAQ

What does formatting JSON do?

It re-indents the data so the structure is visible, without changing any values. Minifying does the reverse, stripping whitespace to make the payload as small as possible for transmission. Both produce exactly equivalent JSON.

Why does my JSON fail to parse?

The usual culprits are a trailing comma after the last item, single quotes instead of double quotes, unquoted keys, or a stray comment. JSON is much stricter than JavaScript object syntax. This tool reports the position of the failure so you can find it quickly.

Is my data sent to a server?

No, and for this tool that matters more than most. JSON pasted into a formatter often contains API responses, tokens, or customer data. Everything here is parsed in your browser with the built-in JSON engine — nothing is uploaded, logged, or stored.

Does formatting change my data?

Only its whitespace. Key order is preserved, and values are untouched. One caveat: JSON numbers beyond JavaScript's safe integer range may lose precision when parsed, which is a property of JSON in JavaScript rather than of this tool.

Can it handle large files?

Yes, within reason. Parsing happens in your browser, so very large documents are limited by your device's memory rather than by an upload limit. Files of a few megabytes format without trouble on a typical machine.