JSON Validator
Validate JSON and find the exact error
Check JSON syntax instantly. Invalid JSON is underlined in red at the precise line and column, with a plain-English reason and a one-click fix — nothing leaves your browser.
🔒 100% private — your document is processed entirely in your browser and is never uploaded, logged, or stored.
Stop guessing where your JSON breaks
A validator that only says “Invalid JSON” wastes your time. Indentioshows the exact character where parsing failed, names the cause — a trailing comma, a single quote, an unclosed bracket — and suggests how to fix it. Valid JSON gets a clear green status.
What “valid JSON” actually requires
JSON’s grammar is famously small — it fits on a business card — and a document is valid if and only if it obeys every one of these rules:
- Exactly one top-level value. Usually an object or array, but a bare string, number,
true,false, ornullis also a complete JSON document. Two values side by side is not. - Strings use double quotes. Never single quotes, never backticks — for values and for object keys alike.
- Keys must be quoted strings.
{ name: 1 }is JavaScript, not JSON. - Commas separate, never terminate. No comma after the final element of an array or the final property of an object.
- Numbers follow one strict format — optional minus, digits, optional fraction, optional exponent. No leading zeros (
012), no leading plus, no trailing decimal point (1.), no hex, and noNaNorInfinity. - Only three literals exist, all lowercase:
true,false,null. NotTrue,None, orundefined. - No comments. Neither
//nor/* */is part of JSON. - Control characters must be escaped inside strings — a literal newline or tab between quotes is invalid and must be written
\nor\t.
The full breakdown, with examples of each, is in theJSON syntax rules guide.
Reading the error message
Parser errors describe the moment the parser gave up, which is frequently one or more lines after the mistake itself. Knowing the translation saves a lot of scrolling:
| Message | What it usually means |
|---|---|
Unexpected token } in JSON | A trailing comma just before that brace, or a missing value after a key. |
Unexpected end of JSON input | A bracket or brace was never closed. The document is truncated — often a partial download or a log line cut off at a length limit. |
Expected property name or '}' | An unquoted key, or a stray comma directly after {. |
Unexpected token ' in JSON | Single quotes. The document is almost certainly a Python dict or a JavaScript object literal. |
Unterminated string | A missing closing quote, or an unescaped backslash swallowing it — a Windows path such as "C:\Users" is the classic case. |
Unexpected non-whitespace character after JSON | Two top-level values. Usually NDJSON — several JSON objects, one per line — being fed to a plain JSON parser. |
Because Indentio validates live and marks the position in the editor rather than reporting an offset, you can usually skip this translation entirely — but it is useful when the message comes from your own build log or server.
Your file might not be plain JSON
A surprising share of “invalid JSON” is valid — as something else. These formats look like JSON and are deliberately not:
- JSONC / JSON with comments — what
tsconfig.json,.eslintrc.json, and VS Code’s settings actually use. Comments and trailing commas are allowed because the tools reading them ship a lenient parser. Strict JSON parsers reject both. - JSON5 — an explicit superset allowing unquoted keys, single quotes, trailing commas, hex numbers, and
Infinity. Valid JSON5, invalid JSON. - NDJSON / JSON Lines — one complete JSON value per line, no enclosing array, the standard shape for log and analytics exports. Each line validates on its own; the file as a whole does not.
- A Python
dictor JavaScript object literal pasted from a console — single quotes,True,None. Usejson.dumps()rather thanprint()and it comes out as real JSON.
If your document is one of these, Auto-fix will convert most of them into strict JSON in one click — comments stripped, quotes normalised, trailing commas removed.
Valid here, rejected by your API
Syntax is only the first gate, and three things pass a validator while still breaking a real consumer:
- Duplicate keys.
{ "id": 1, "id": 2 }is syntactically legal — the specification simply says the behaviour is undefined. Most parsers keep the last value, some keep the first, and a strict server may reject the document outright. - Integers that exceed the safe range. JSON numbers have no size limit, but JavaScript parses them as 64-bit floats, so anything above 253 silently loses precision — a Twitter-style 64-bit id arrives subtly wrong. This is why large identifiers are so often transmitted as strings.
- A byte-order mark. Three invisible bytes at the start of a UTF-8 file. Some parsers skip it, many treat it as an unexpected token at position 0 on a document that looks flawless.
Beyond those, the API is applying its own schema: required fields, expected types, permitted values. That is a different question from “is this JSON?”, and a syntax validator cannot answer it.
Validate, then fix
- Live validation as you type, with a status of Valid or the first error’s location.
- Hover any red underline for the reason and a targeted hint.
- Click Auto-fix to repair common issues, or Format to beautify once valid.
- Everything runs locally, so credentials, tokens, and customer data in a document you are debugging never leave your machine.
Go deeper
Frequently asked questions
How do I check if my JSON is valid?
Paste it into the editor. Validation runs automatically as you type: a green status means valid JSON, and any error is underlined in red with its exact line and column.
What does the validator check?
It checks JSON syntax against the specification — quoting, commas, brackets, braces, and value types — and reports the first problem with a precise location and a fix suggestion.
Why does it say “trailing comma”?
JSON, unlike JavaScript, does not allow a comma after the last item in an array or object. The validator points at the exact comma so you can remove it — or click Auto-fix.
Does it validate against a JSON Schema?
Not yet. This is a syntax validator: it answers “is this parseable JSON?”, which is the question behind almost every error you hit. Checking a document against a JSON Schema — required fields, types, value ranges — is a separate step and is on the roadmap.
My JSON is valid here but my API still rejects it. Why?
Because “valid JSON” and “the JSON this endpoint expects” are different claims. Syntax is only the first gate — the API may additionally require particular fields, types, or a specific top-level shape. See the section on this above; duplicate keys, large integers, and a byte-order mark are the three usual culprits.
Does it store the JSON I paste?
No. Validation happens entirely in your browser; nothing is uploaded or saved.