Format and validate JSON for free in your browser
Paste JSON to validate and format it as you type, with 2 spaces, 4 spaces, tabs or minified, and errors shown by line and column.
How to use JSON Formatter & Validator
- Paste or type your JSON.
- Pick 2 spaces, 4 spaces, tabs or minified, or fix the error shown at its line and column.
- Copy the result or save it as a .json file.
Questions
- How do I find the error in my JSON?
- When the JSON is invalid, the tool shows the line and column of the first problem and what it expected there, such as a missing comma, a trailing comma, single quotes or an unquoted property name.
- How do I minify JSON?
- Choose Minified as the format. All whitespace between values is removed, and you can copy the result or save it as minified.json.
- Will formatting change my numbers?
- In browsers that support it, including current Chrome and Edge, numbers are kept exactly as written, so large integers like 12345678901234567890 and values like 1.10 stay unchanged. Other browsers convert numbers to standard floating point, which can round very large integers.
- Does it accept comments or trailing commas?
- No. It checks strict JSON, the same rules JSON.parse uses, so comments, trailing commas, single quotes and unquoted keys are reported as errors.
- Does it remember my indentation?
- Yes. The format you choose is stored in this browser and used the next time you open the tool.