JSON.Formatter

Paste JSON to format, minify, sort and validate. Errors show the exact line and column.

Free JSON formatter and validator

Paste any JSON and this tool formats it with clean indentation, minifies it for production, or sorts the keys alphabetically. It validates as you type and points to the exact line and column of the first error, so you can fix a missing comma or stray quote quickly.

Everything runs in your browser. Your JSON is never uploaded, which makes it safe to use with API responses and config files. A note on numbers: JavaScript cannot hold integers larger than 9,007,199,254,740,991 exactly, so very large IDs may be rounded when formatted.

How to use it

  1. Paste your JSON into the input box.
  2. Choose an indent size and press Format, or press Minify.
  3. Copy or download the result. Fix any error shown with its line and column.

Frequently asked questions

How do I validate JSON?

Paste it in. The status line shows "Valid JSON" or the exact line and column of the first error.

What are the most common JSON errors?

Trailing commas, single quotes instead of double quotes, unquoted keys, missing commas between items and comments, none of which are allowed in JSON.

Is my JSON uploaded anywhere?

No. Formatting and validation happen entirely in your browser.

More free tools