JSON Formatter and Validator

Paste JSON to beautify, minify, sort keys and find errors. Nothing is sent to a server.

Quick answer: The JSON Formatter validates JSON and formats it with 2 or 4 spaces or tabs, minifies it, or sorts its keys. If the JSON is invalid it shows the error with the line and column.

How to use JSON Formatter

  1. Paste your JSON into the box.
  2. Press Format to beautify, Minify to compress, or Sort keys.
  3. Fix any error shown with its line and column.
  4. Copy the result or download it as a .json file.

Features

Frequently asked questions

How do I validate JSON?

Paste it and press Format. A green message means it is valid. Otherwise the tool shows the error.

What is the difference between format and minify?

Format adds line breaks and indentation for reading. Minify removes all extra spaces to make the file smaller.

Is my JSON sent anywhere?

No. It is processed in your browser.

Why does JSON fail with a trailing comma?

Standard JSON does not allow a comma after the last item, or single quotes around keys.

More free tools