JSON Formatter & Validator
Format, validate, and inspect JSON with clear error positions.
Runs locally in your browser. Your input is not uploaded or stored. You can verify this in your browser’s network panel.
What does this tool solve?
Paste JSON or JSON5 above, choose whether to sort keys and how many spaces to indent, then copy the prettified result. Minify and validation remain available as LessInAI extensions.
What examples should you start with?
Format compact JSON
Input
{"a":[1,2],"b":{"c":true}}Output
{
"a": [
1,
2
],
"b": {
"c": true
}
}Minify formatted JSON
Input
{
"a": 1
}Output
{"a":1}Broken JSON
Input
{"a": }Output
Error: Unexpected token } in JSON at position 6 (line 1, column 7)
How does it work?
The IT Tools behavior parses JSON5, optionally sorts object keys recursively, and serializes the data with the selected indentation. The resulting output is strict JSON.
Validation failures report the parser's error message, augmented with a line and column derived from the error position.
What are the edge cases and limits?
- JSON5 comments, trailing commas, and single-quoted strings are accepted as input, but they do not appear in the strict JSON output.
- Numbers outside the IEEE-754 double range lose precision, which is standard JSON behavior in JavaScript.
- Duplicate keys are legal in JSON; the last value wins after parsing.
- Very large documents are handled in memory; extremely large files may be slow on low-end devices.
Technical reference
Related tools
- YAML ↔ JSON ConverterConvert YAML to JSON and JSON to YAML without losing structure.
- JSON ↔ CSV ConverterTurn JSON arrays into CSV rows and CSV data back into JSON.