JSON Formatter and Validator

Paste JSON to make it readable, check it for errors or shrink it to one line.

Runs in your browser. Nothing is uploaded.

Report a problem with this tool

How to format JSON

  1. Paste your JSON into the box, or drop a .json file onto it.
  2. Click Format to indent it, or Minify to remove all spaces and line breaks.
  3. If the JSON is invalid, the tool shows the line and column of the first error and selects that spot in the box.

Common JSON errors

  • A comma after the last item, as in [1, 2, 3,]. JavaScript allows it but JSON does not.
  • Single quotes. JSON strings and keys need double quotes, so 'name' must be "name".
  • Keys without quotes, such as {name: "x"}. Every key has to be a quoted string.
  • Comments. JSON has no comments, so remove any lines starting with //.
  • A missing comma between two items, which often happens after pasting lines together.

Frequently asked questions

Is my JSON sent to a server?

No. Formatting and validation run in your browser, so API keys, tokens and customer data in your JSON stay on your device.

What does Minify do?

It removes every space and line break that isn't inside a string. The data stays the same but the file gets smaller, which is useful for config files and API requests.

Why did a long number change after formatting?

Browsers store numbers with about 15 to 17 significant digits, so very long integers such as some database IDs get rounded. Store them as strings if you need every digit.

More free tools