JSON formatter & validator
Validate, format and minify JSON with line/column errors, copy and file download.
Processed in this browser · nothing is uploaded
Result
Ready when you areEnter your input and run the tool to see your result here.
Good to know
Use double quotes for keys and strings. Trailing commas and comments are not valid JSON. Choose two/four-space formatting or minification. Key sorting preserves array order. Duplicate keys keep the last value; store large integers as strings to avoid JavaScript precision loss.
{"name":"OpenTool","private":true,"tools":30}Understand and use your results
Make API responses or JSON configuration readable and locate syntax errors. This formats JSON; it does not validate business rules against a JSON Schema.
How to use it
- Paste JSON and choose two-space, four-space or compact output.
- Optionally sort keys and run. If parsing fails, check the reported line and column.
Worked example
{"b":2,"a":1} (sort keys){
"a": 1,
"b": 2
}Key sorting also applies to nested objects, while array element order stays unchanged. Compact output removes formatting whitespace, not spaces inside strings.
Can a valid JSON value change during formatting?
Large integers can be rounded by JavaScript number parsing, and duplicate keys keep only the last value. Store exact large identifiers as strings and resolve duplicate keys in the source. Comments, trailing commas and single quotes are not standard JSON. The input limit is 100,000 UTF-16 code units.