Tools JSON
JSON Formatter & Validator
Beautify, minify and validate JSON, with exact error locations.
🔒 Runs in your browser. Nothing is uploaded.How to use it
- Paste your JSON into the left box, or click "Load example".
- Choose Format (2 spaces, 4 spaces or tabs) or Minify. The result updates as you type.
- If the JSON is invalid, click the line and column in the error to jump straight to the problem.
- Turn on Lenient parse to repair almost-JSON with comments, trailing commas, single quotes or unquoted keys.
- Copy the result or download it as a .json file.
Questions
What does Lenient parse do?
It reads the input as JSON5, which allows comments, trailing commas, single-quoted strings and unquoted keys, and writes it back out as strict, valid JSON. It is the quickest way to fix JSON copied from a config file or JavaScript code.
Why did a large number change?
JavaScript stores numbers as 64-bit floats, so integers above 9,007,199,254,740,991 (2^53 − 1) lose precision when parsed. The formatter warns you when this happens. Store such IDs as strings to keep them exact.
Is my JSON sent to a server?
No. Parsing and formatting happen in your browser, and the page’s security policy stops it from sending your data anywhere. You can check in your browser’s network tab.
Does Sort keys change arrays?
No. It sorts the keys of every object alphabetically, at every level, but leaves the order of array items alone, because that order is part of the data.