JSON Validator
Paste JSON and get instant validation. Syntax errors show the exact line and column. Common mistakes — single quotes, trailing commas, unquoted keys — are auto-repairable in one click.
What the validator catches
Trailing commas
{ "a": 1, } — valid JavaScript, invalid JSON. The validator identifies the exact position and the repair removes it.
Single-quoted strings
{ 'name': 'Alice' } — JSON requires double quotes. Single quotes are the most common mistake when copying from JavaScript source.
Unquoted keys
{ name: 'Alice' } — JavaScript object syntax. JSON requires all keys to be double-quoted strings.
JavaScript-only values
undefined, NaN, Infinity, and -Infinity are valid JavaScript but invalid JSON. Auto-repair replaces them with null.
Missing or extra brackets
A missing } or ] at the end of a deeply nested structure produces a cryptic end-of-input error. The line number tells you where to look.
Comments in JSON
// and /* */ comments are valid in JavaScript and YAML but invalid in JSON. The validator reports the exact line so you can remove them.
Example
JavaScript object literal with 4 JSON violations — all auto-repairable
{
name: 'Alice',
age: 30,
active: true,
score: NaN,
}{
"name": "Alice",
"age": 30,
"active": true,
"score": null
}Unquoted keys quoted, single quotes converted to double, NaN replaced with null, trailing comma removed. All 4 fixes applied in one click.
Frequently asked questions
My JSON is valid but my API is rejecting it. What else could be wrong?
Syntax validation only checks structure — it can't verify that the right fields are present, that values have the expected types, or that required fields aren't missing. If the JSON is syntactically valid but your API rejects it, the problem is semantic: a required field is absent, a value is the wrong type, or a string contains invalid characters for that field. You need a JSON Schema validator for that level of checking.
What's the difference between JSON and a JavaScript object literal?
JavaScript object literals allow single quotes, unquoted keys, trailing commas, comments, undefined, NaN, and Infinity. JSON forbids all of these — it's a strict data interchange format, not JavaScript syntax. This validator shows exactly which JavaScript-isms are present in your input.
Can it fix my broken JSON automatically?
For common issues — single quotes, trailing commas, unquoted keys, NaN/undefined/Infinity values — yes. Click Auto-repair and the tool applies all fixable repairs at once and lists what changed. Deeply malformed JSON (mismatched brackets, truncated files) can't be auto-repaired because the correct structure is ambiguous.
The error says 'Unexpected token at position 847' — how do I find that?
Click 'Jump to line' next to the error. The cursor jumps to the exact character that caused the parse failure. The column number in the error message also tells you how far into the line the problem is.
I need to validate JSON against a schema (not just syntax). Can this do that?
No — this tool validates JSON syntax only. For schema validation (required fields, value types, format constraints), use a JSON Schema validator like Ajv in your application code or a dedicated JSON Schema linter.
Related Tools
All conversions run in your browser — nothing is uploaded.
Browse all 26 converters →