JSON Validator
Input
Loading editor…
Validation Result

Paste or type JSON in the editor
to validate it

JSON Validator

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.

Real-time
Validates as you type.
Statistics
Size, depth, key count.
Error detail
Exact parser error message.
Squiggles
Inline error highlighting in the editor.

What Makes JSON Invalid?

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:

ErrorInvalidFixed
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}

JSON vs JSON5 and JSONC

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.

JSON Syntax Validation vs JSON Schema Validation

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 validationSchema validation
ChecksBrackets, quotes, commasFields, types, constraints
Input neededJSON onlyJSON + Schema
ToolThis validatorJSON 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.

Frequently Asked Questions

What is JSON validation?

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.

Why is my JSON showing as invalid?

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).

What is the difference between JSON and JavaScript objects?

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.

Does the validator show where the error is?

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.

What statistics does the validator show?

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.

What is the difference between JSON validation and JSON Schema validation?

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.

Is my JSON data uploaded anywhere?

No. Validation uses the browser's built-in JSON.parse — there's no server involved at any point.

More Tools