How to format and validate JSON
- Paste your JSON into the input box.
- Click Format to pretty-print it, or Minify to compress it.
- If the JSON is invalid, you'll see what's wrong and the exact line and column.
JSON syntax rules
- Data is written as
"name": value pairs, and property names must be in double quotes.
- Values can be strings (in double quotes), numbers,
true, false, null, objects { } or arrays [ ].
- Items are separated by commas, with no comma after the last item.
- Comments are not allowed.
Example
This compact JSON:
{"name":"Ada","languages":["English","French"]}
becomes, after formatting:
{
"name": "Ada",
"languages": [
"English",
"French"
]
}
Frequently asked questions
What does a JSON formatter do?
It takes compact or messy JSON and adds consistent indentation and line breaks so it's easy to read. It also checks that the JSON is valid and points to the exact location of any error.
What are the most common JSON errors?
Trailing commas after the last item, single quotes instead of double quotes, unquoted property names, and comments. All of these are allowed in JavaScript but not in strict JSON.
What does minify do?
Minifying removes all unnecessary whitespace, making the JSON as small as possible. That's useful for sending data over a network or storing it compactly.
Is my JSON sent to a server?
No. Formatting and validation run entirely in your browser, so it's safe to use with API keys, tokens or private data.