JSON Formatter and Validator

Paste JSON to format it with indentation, minify it, or check whether it is valid. Errors are reported straight from your browser's JSON parser. Your data stays on your device.

JSON editor

How to format and validate JSON

  1. Paste your JSON into the Paste JSON box.
  2. Press Format JSON for readable two-space indentation, Minify JSON to remove whitespace, or Validate to check syntax only.
  3. Read the message under the buttons. If the JSON is invalid, it explains what the parser found.
  4. Press Copy result to copy the output.

Common JSON errors and how to fix them

How to read the JSON error message

The message comes from your browser, so wording varies. It usually names the unexpected token and where it was found. Look at the character just before that position, because the real mistake is often a missing comma or quote right before it.

Formatted vs minified JSON

Both contain exactly the same data. Formatted JSON adds line breaks and indentation so people can read it; minified JSON removes all optional whitespace to make it shorter for sending or storing. Neither encrypts or protects the data.

JSON is not the same as a JavaScript object

JavaScript lets you skip quotes on keys, use single quotes, add comments and leave trailing commas. JSON does not. Code copied from a script often needs those changes before it validates.

Frequently asked questions

How do I format JSON in one click?

Paste it into the input and press Format JSON. The result appears in the output box with two-space indentation.

Why does my JSON say unexpected token?

The parser hit a character it did not expect, commonly a trailing comma, single quote, comment or missing bracket. Check the position named in the message.

Can I validate JSON that contains comments?

No. Standard JSON has no comments. Remove them and validate again.

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser. Still, avoid pasting secrets such as API keys into any online tool you do not control.

Is there a size limit?

No fixed limit. Very large documents depend on your device's memory and may make the page slow.

More free tools