JSON Validator — Check and Debug JSON Syntax Online
FreeValidate JSON syntax online. Finds exact line and column of every error with a plain-English explanation. RFC 8259 compliant. Free, runs in your browser.
What's next
Settings guide
Validation modes:
- ·Strict JSON (RFC 8259) — The standard. Flags trailing commas, single-quoted strings, unquoted keys, and comments. Use this when JSON will be consumed by any standard JSON parser.
- ·JSON5 / JSONC — Accepts JavaScript-style comments, trailing commas, and unquoted keys. Use for VS Code settings, TypeScript tsconfig, and Babel configs that use a relaxed JSON superset.
Common errors and what they mean:
- ·
Unexpected token ,— Trailing comma after the last key or array element. - ·
Unexpected token '— Single-quoted string. JSON requires double quotes. - ·
Unexpected end of JSON input— Missing closing bracket}or], usually from a truncated copy-paste. - ·
Unexpected token //— JavaScript comment in JSON. Comments are not valid JSON.
Format comparison
Validator vs formatter: The formatter flags the first syntax error it encounters as a side effect. The validator specifically finds and lists all errors with detailed location and explanation. When debugging, start with the validator; once the JSON is valid, format it for readability.
Syntax validation vs schema validation: Syntax validation confirms the text is parseable JSON. Schema validation confirms the parsed data matches a defined structure — required fields, correct types, value constraints. Both are needed in API development: syntax validation at the parsing stage, schema validation at the business logic stage.
How it works
Lex
The input is scanned character by character, converting it into a token stream: strings, numbers, punctuation, whitespace. Characters that cannot form valid tokens are flagged immediately.
Parse
Tokens are checked against JSON grammar rules. The parser tracks bracket nesting depth, verifies key-value pair structure in objects, and validates that separators appear in syntactically correct positions.
Report all errors
Every syntax violation is reported with its line number, column, and a plain-English explanation of what was expected. All errors in the document are shown — not just the first.
Fix and re-validate
Edit the input directly and validation runs live as you type. Each fix is confirmed the moment the corrected character is entered — no need to re-submit.
About this format
A JSON parse error in production — `SyntaxError: Unexpected token`, `JSON.parse: bad value at line 1 column 1247` — rarely points to the right place. The validator locates every syntax violation in your JSON with the exact line number, column, and a plain-English description of what the parser expected instead.
Three sources cause most invalid JSON: API serialisers with edge-case bugs (unescaped special characters, mishandled nulls), config files hand-edited by developers unfamiliar with JSON's stricter-than-JavaScript rules, and JSON copied from JavaScript source code where trailing commas and comments are legal.
Paste and validate — no settings required. Errors are listed in order of occurrence, not just the first one found.