JSON Formatter & Validator

Format, validate and minify JSON, with clear error messages for invalid input.

How to format and validate JSON

Paste your JSON into the box and press Format. Valid JSON is re-indented in place; invalid JSON produces an error message with the position of the problem so you can fix it. Press Minify to strip whitespace before sending the data over a network or embedding it in code.

JSON rules worth remembering

  • Property names and strings must use double quotes.
  • No trailing commas and no comments.
  • Values can be strings, numbers, true, false, null, arrays or objects.

Frequently asked questions

Is my JSON sent to a server?

No. Parsing and formatting happen in your browser with the built-in JSON engine, so API responses and configuration files with private data never leave your device.

Why is my JSON invalid?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, unquoted property names, and comments. JSON allows none of these.

What is the difference between formatting and minifying?

Formatting adds line breaks and indentation so people can read the data. Minifying removes all optional whitespace to make the file as small as possible for transfer.

Related tools