Format
Rewrites your JSON with clean line breaks and indentation so nested objects and arrays are easy to read. Your data is not changed, only the spacing.
{"a":1,"b":[2,3]}After{
"a": 1,
"b": [2, 3]
}Paste JSON to check it, then format it with clean indentation or minify it to a single line. The tool tells you right away if the JSON is valid, and points at the exact line and column when it is not. Everything runs in your browser, so your data stays on your device.
JSON is a plain text format for storing and sending data, used by most APIs and config files. It is easy for machines to read, but a long string on one line is hard for a person to follow. Formatting rewrites that string with line breaks and indentation so the structure is clear, without changing any of the data. This tool formats your JSON, checks that it is valid, and can minify it back down to the smallest single-line version when you need it.
Rewrites your JSON with clean line breaks and indentation so nested objects and arrays are easy to read. Your data is not changed, only the spacing.
{"a":1,"b":[2,3]}After{
"a": 1,
"b": [2, 3]
}Strips every space and line break to give you the smallest valid JSON on a single line. Good for saving space in a request body or config value.
{
"a": 1,
"b": 2
}After{"a":1,"b":2}Choose 2 spaces, 4 spaces, or a tab for each level. Pick the one that matches your codebase so the result drops straight in without reformatting.
{"a":1}After{
"a": 1
}Puts the keys of every object in alphabetical order, all the way down. Array order is left alone, since the position of items in a list has meaning.
{"name":"pear","age":2}After{
"age": 2,
"name": "pear"
}JSON is stricter than JavaScript, so text that looks fine can still fail. These are the mistakes behind most errors, with the message Chrome shows for each:
| Problem | Example | Fix |
|---|---|---|
| Trailing comma after the last item | {"a": 1,} | Delete the last comma. Chrome says: “Expected double-quoted property name”. |
| Single quotes | {'a': 1} | Use double quotes for keys and text values. |
| Keys without quotes | {a: 1} | Put every key in double quotes: "a". |
| Missing comma between items | {"a": 1 "b": 2} | Add a comma. Chrome says: “Expected ',' or '}' after property value”. |
| Comments | {"a": 1 // note} | JSON has no comments. Remove them, or move the note into a value. |
| NaN, undefined, or Infinity | {"a": NaN} | Use null or a number instead. |
| Curly quotes from a doc or chat | {“a”: 1} | Replace the curly quotes with straight ones. |
The error message gives a line and column. The real mistake is often just before that spot, since the parser only notices a problem when it reaches the next character it did not expect.
JSON turns up all over modern development, and it is often packed onto one line. Here are the most common reasons people format and check it: