All tools

JSON formatter & validator

Paste JSON, pick what to do with it.

Output
Output appears here.

About the json formatter

Format, minify, sort keys and validate JSON. Paste an unreadable API response or config and get it back indented, compacted, or with keys in alphabetical order, and see the error if it does not parse. JSON is sent to our server for processing, so avoid pasting secrets.

How to use it

  1. Paste your JSON into the Input box.
  2. Click Format to pretty-print, Minify to strip whitespace, or Sort keys to alphabetise object keys.
  3. Click Validate to check whether it parses; errors are shown above the editor.
  4. Copy the result from the Output panel.

Questions

Why is my JSON invalid?
The usual causes are trailing commas, single-quoted strings, unquoted keys and comments. All are allowed in JavaScript but not in JSON.
Why would I sort JSON keys?
Sorted keys make two JSON documents easy to diff, because the same data always appears in the same order.
What is the difference between formatting and minifying JSON?
Formatting adds indentation and line breaks for people to read. Minifying removes all unneeded whitespace to make the payload smaller. The data is identical either way.