How to format and validate JSON
- Paste an API response or configuration, or open a JSON file from your device.
- Choose Format JSON for indentation, Validate to check syntax, or Minify to remove whitespace.
- If there is an error, jump to its location in the input. Otherwise, explore the tree, copy the result or download a JSON file.
Readable JSON without lost precision
An identifier such as 9007199254740993 is larger than JavaScript’s safe integer range. A formatter that parses and reserializes ordinary JavaScript numbers can round it. This tool works with the original tokens, so large integers, decimal notation and string escapes survive formatting.
Duplicate keys also stay in the output, with a warning. They are legal syntax but ambiguous for consumers: a parser may keep only the last value. Resolve the duplicates in your source before relying on them.
Fix the syntax, then inspect the data
Use double quotes around keys and strings, remove the final comma in an object or array, and check matching brackets. Validation checks JSON syntax; it cannot tell whether an API expects a different field or value.
Working with a spreadsheet export instead? Open it in the CSV viewer, then export its rows as JSON arrays. To compare a downloaded file with its publisher’s checksum, use the file checksum generator.
Frequently asked questions
Does this formatter change numbers or duplicate keys?
Formatting changes whitespace only. Number literals, string escapes, key order and duplicate keys stay intact. Duplicate keys are flagged because other JSON software may discard earlier values.
What does the JSON validator check?
It checks strict JSON syntax and reports the first error with a line and column. Comments, trailing commas, single-quoted strings, NaN and Infinity are not valid JSON. It does not validate against a JSON Schema.
Is my JSON stored or uploaded?
No. Your input is processed in this browser tab and is not saved to local storage. Clear the tool or close the tab when you finish. Downloads are saved only when you choose to download.
How large can my JSON be?
You can open or paste up to 5 MB, with up to 128 nesting levels. The tree preview shows up to 2,000 values; formatted and minified downloads contain the full document.