JSON Formatter & Validator

Results

JSON is the standard format for data in web APIs and config files. Machines don’t need spaces, but people do: this tool lays JSON out so you can read it, or squeezes it onto one line to save space, and tells you where it’s broken.

How to use it

  1. Paste your JSON.
  2. Choose the indent, or Minify.
  3. Copy or download the result.

Example: {"b":1,"a":[1,2]} with Sort keys and 2 spaces becomes:

{
  "a": [
    1,
    2
  ],
  "b": 1
}

Questions and answers

Why is my JSON invalid?

The usual suspects: a comma after the last item, single quotes instead of double quotes, keys without quotes, or comments. JSON allows none of these.

Are big numbers kept exactly?

Numbers beyond about 16 significant digits (such as 64-bit IDs) may be rounded, because they’re read as standard numbers. Keep such IDs as strings in quotes.

Link with pre-filled values

Add # and these parameters to the end of this page's address to open the tool with values already filled in.

ParameterWhat it sets
textThe JSON to format.
indent2, 4, tab or min (minify).
sort1 to sort object keys.

Example: https://toolabelle.com/json-formatter/#text=%7B%22b%22%3A1%2C%22a%22%3A%5B1%2C2%5D%7D&indent=2&sort=1

Related tools