What the JSON formatter does
- Beautify: adds line breaks and indentation so JSON is easy to read.
- Minify: removes all whitespace to make the payload as small as possible.
- Validate: checks the JSON against the standard (RFC 8259) and points to the first error.
- Sort keys: orders object keys alphabetically, which makes two JSON files easier to compare. To see exact differences, use the JSON diff tool.
Common JSON errors
| Error | Fix |
|---|---|
Trailing comma: [1, 2,] | Remove the last comma |
Single quotes: {'a': 1} | Use double quotes: {"a": 1} |
Unquoted keys: {a: 1} | Quote every key |
Comments: // note | JSON has no comments; remove them |
undefined, NaN | Use null or a number |
Is it safe to paste private JSON?
Yes. Formatting and validation run in your browser with JavaScript's built-in parser. Nothing you paste is sent to a server.