Paste or type JSON in the editor
to validate it
Paste your JSON and get instant validation feedback. Invalid JSON is caught immediately with a clear error message from the parser. Valid JSON shows a structural breakdown — size, root type, key count, nesting depth, and more.
JSON is stricter than JavaScript objects. Keys must be double-quoted strings, trailing commas are not allowed, and values must be one of: string, number, object, array, true, false, or null. Single quotes, comments, and undefined are not valid JSON.
Here are the most common errors and how to fix them:
| Error | Invalid | Fixed |
|---|---|---|
| Trailing comma in object | {"a":1,"b":2,} | {"a":1,"b":2} |
| Trailing comma in array | [1,2,3,] | [1,2,3] |
| Unquoted key | {name:"Alice"} | {"name":"Alice"} |
| Single-quoted string | {"name":'Alice'} | {"name":"Alice"} |
| Comment | {"a":1 // comment} | Remove the comment |
| Undefined value | {"a":undefined} | Use null instead |
| Unquoted string value | {"status":active} | {"status":"active"} |
| Missing comma between items | {"a":1 "b":2} | {"a":1,"b":2} |
If your JSON contains comments or trailing commas and you wonder why it fails, you are probably working with JSONC or JSON5 — extended formats that relax the spec.
JSONC (JSON with Comments) is what VS Code uses for settings.json, launch.json, and TypeScript uses for tsconfig.json. It permits // and /* */ comments and trailing commas after the last item.
JSON5 goes further: single-quoted strings, unquoted keys, hex numbers, and multiline strings are all valid JSON5 but invalid JSON.
Neither format is parseable by JSON.parse(). This validator checks against the strict ECMA-404 spec. To use tsconfig.json or VS Code settings here, strip the comments first.
There are two distinct types of JSON validation — they answer different questions:
Syntax validation (this tool) — asks: Is this valid JSON? It checks that the text is parseable according to the JSON specification. It says nothing about the shape, types, or required fields of the data.
Schema validation — asks: Does this JSON match the expected structure? It checks that specific fields exist, have the right types, and satisfy constraints like minLength or enum. This requires a JSON Schema document.
| Syntax validation | Schema validation | |
|---|---|---|
| Checks | Brackets, quotes, commas | Fields, types, constraints |
| Input needed | JSON only | JSON + Schema |
| Tool | This validator | JSON Schema tool |
| Error example | "Unexpected token }" | "Field 'email' is required" |
For API development, both are needed: syntax validation catches malformed payloads at the edge, schema validation enforces the contract in the application layer.
JSON validation checks whether a string conforms to the JSON specification. It catches syntax errors like missing quotes, trailing commas, mismatched brackets, and invalid values.
The most common causes are: trailing commas after the last item in an object or array, keys not wrapped in double quotes, single quotes used instead of double quotes, or comments included in the JSON (comments are not valid in JSON).
JSON is stricter than JavaScript objects. JSON keys must be double-quoted strings, values can only be strings, numbers, booleans, null, arrays, or objects. JavaScript objects allow unquoted keys, single quotes, comments, functions, and undefined — none of which are valid JSON.
Yes. The validator shows the exact error message from the JSON parser with the position of the error, and highlights the problem location inline in the editor.
For valid JSON, the validator shows file size, root type (Object, Array, etc.), total key count, maximum nesting depth, number of arrays, and line count.
JSON validation checks syntax — is this parseable JSON? JSON Schema validation checks structure — does this JSON have the right fields, types, and values? Use this tool to check syntax, and the JSON Schema tool to validate against a schema.
No. Validation uses the browser's built-in JSON.parse — there's no server involved at any point.
More Tools