beautify JSON
Beautifies or minifies JSON.
Paste JSON to check whether it is valid. When it isn't, the JSON validator points to the exact line and column and explains the fix in plain English.
.json file up to 5 MB.The validator uses a strict parser that follows RFC 8259, the JSON standard. It stops at the first error and reports where it is. These common mistakes get a plain-language explanation:
} or ]// or /* */)NaN, Infinity, or undefined as valuesFor valid JSON, the stats show the root type, the number of keys and values, the maximum nesting depth, and the size.
{"a": 1,} is invalid: there is a trailing comma before }. Fix: remove the last comma.{'a': 1} is invalid: JSON strings and keys need double quotes.{"a": [1, 2, {"b": null}]} is valid: the root is an object, and the maximum depth is 3.| Error | Invalid | Valid |
|---|---|---|
| Trailing comma | {"a": 1,} | {"a": 1} |
| Single quotes | {'a': 1} | {"a": 1} |
| Unquoted key | {a: 1} | {"a": 1} |
| Comment | {"a": 1 // note} | {"a": 1} |
| NaN or undefined | {"a": NaN} | {"a": null} |
| Missing comma | {"a": 1 "b": 2} | {"a": 1, "b": 2} |
Most of these come from copying a JavaScript object or a config file written in JSON5. Real JSON is stricter than JavaScript.
The most common causes are trailing commas, single quotes, unquoted keys, and comments. JSON allows none of these.
No. The JSON standard has no comment syntax. Formats such as JSON5 and JSONC allow comments, but standard parsers reject them.
Not yet. It checks syntax only.
Yes. Validation runs in your browser, and nothing is uploaded.
Often used together with the JSON Validator.
Beautifies or minifies JSON.
Turns YAML configuration into JSON.
Turns an array of JSON objects into a CSV table.