JSON Formatter
Format, pretty-print, and validate JSON in your browser.
Validate JSON syntax and pinpoint errors with clear location hints.
JSON Validator checks whether your JSON text is syntactically correct. When there is an error, it shows the error message and highlights the approximate location. When the JSON is valid, it displays structural information such as the number of keys, maximum nesting depth, and array count. Useful for debugging API responses, configuration files, and hand-written JSON.
^, so you can jump straight to the problem.Input:
{
"name": "Taro",
"age": 28,
"tags": ["admin", "editor"],
"address": {
"city": "Tokyo",
"zip": null
}
}
Result:
Status: Valid JSON
Root type: Object
Keys: 6
Max depth: 2
Arrays: 1
Nulls: 1
Notice how the single tags array and the single zip: null inside address are both correctly counted.
Input:
{"name": "Taro", "age": 28,}
There’s an extra comma right after the age value, which makes this invalid JSON.
Result:
Status: Invalid JSON
Error: Expected double-quoted property name in JSON at position 27 (line 1 column 28)
Location:
...: "Taro", "age": 28,}...
^
The ^ marker points to the position right before the closing } — that’s where the stray trailing comma is. Removing it produces valid JSON.
, left after the last element of an array or objectJSON Formatter focuses on pretty-printing and minifying. JSON Validator focuses on syntax checking, error location, and structural statistics.
The tool extracts the characters around the parse error position and places a "^" marker below the problem character.
No. All processing happens in your browser. Nothing is sent to a server.
The outermost object or array is depth 0, and depth increases by 1 each time a value is nested one level deeper. Deeply nested structures, such as objects inside arrays, produce a higher depth value.
Yes. The root element can be an array, string, number, boolean, or null. When valid, the root type is shown, for example as "Array (N elements)".