Skip to content

JSON Validator — Check and Debug JSON Syntax Online

Free

Validate JSON syntax online. Finds exact line and column of every error with a plain-English explanation. RFC 8259 compliant. Free, runs in your browser.

json validatorcheck json syntaxjson syntax checker
All Developer Tools

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

1

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.

2

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.

3

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.

4

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.

Frequently asked questions

What is the most common JSON syntax error?+
Trailing commas after the last item in an object `{"a": 1,}` or array `[1, 2, 3,]`. JSON forbids trailing commas; JavaScript allows them. The second most common is single-quoted strings — JSON requires double quotes for all strings, including object keys.
My JSON is valid JavaScript but fails the validator — why?+
JavaScript object literals are more permissive than JSON. JavaScript allows unquoted keys, trailing commas, single-quoted strings, and comments. None of these are valid in JSON per RFC 8259. The JSON spec is a strict subset of JavaScript, not the other way around.
What does 'unexpected end of JSON input' mean?+
The parser reached the end of the text before the JSON structure was complete. Usually caused by a missing closing `}` or `]`, a truncated copy-paste, or a file that was saved mid-write. Count your opening and closing brackets.
Can the validator check that my JSON matches a specific structure?+
Syntax validation only checks parsability. For structural validation — required fields, correct types, value ranges — you need JSON Schema. Paste a JSON Schema document alongside your data for full schema validation.
Can I validate JSON from an API response directly?+
Yes. Copy the raw response body from your browser's DevTools Network tab (or from curl output), paste it here, and validate. If the response contains HTTP headers or non-JSON content before the body, strip those first.

Related tools and guides