Free online tools · No sign-up

JSON formatter

Validate JSON syntax, format with two-space indentation or minify, then copy or download. Invalid JSON produces an error; the tool does not repair it.

Local processing · Inputs are not uploaded

Up to 1 MiB. Numbers use JavaScript precision; use strings for very large integers.

Enter content, then choose an action.

How to use

  1. Paste JSON and choose format or minify. Keys and strings need double quotes; comments and trailing commas are rejected.
  2. If syntax is invalid, edit the input and try again. Only valid input produces a result.
  3. Review, copy or download. Numbers use JavaScript precision; store long identifiers as strings. Duplicate keys keep the last value.

Example

{"name":"Ana", "id":"001"}

Minifying gives {"name":"Ana","id":"001"}; formatting adds two-space indentation. {"name":"Ana",} produces an error: remove the trailing comma yourself.

Frequently asked questions

Are JSON comments supported?

No. Remove comments and trailing commas, and use double quotes for property names.

Can large integers lose precision?

The browser JSON parser can lose precision beyond the JavaScript safe integer range. Store long identifiers as strings.

What happens to duplicate keys?

The parser keeps the last value for a repeated key. Do not rewrite a file with this tool if you must preserve duplicate keys.

Related tools