About this tool
A JSON validator answers one question quickly: will a parser accept this? Paste JSON and this tool checks it against the JSON standard (RFC 8259) as you type. When something is wrong you get the exact line and column, the text around the problem with a caret under it, and a plain-English hint such as “Trailing comma: remove the comma before }”. Nothing is uploaded; validation runs in your browser.
More than “valid” or “invalid”
Some JSON is technically valid but still causes bugs. With Warn about risky JSON on, the validator also reports:
- Duplicate keys.
{"total": 42, "total": 45}is accepted by most parsers, but they disagree about which value wins. JavaScript keeps the last one, some libraries keep the first, and strict parsers reject the document. - Numbers too large for JavaScript. Integers above 9,007,199,254,740,991 (253 − 1), such as 64-bit IDs, are silently rounded by browsers and Node.js.
- A byte order mark. Files saved as “UTF-8 with BOM” start with an invisible character that
JSON.parserejects. - Very deep nesting. Some parsers stop at 64 or 100 levels.
Validate JSON Lines (NDJSON)
Logs, exports and data pipelines often use JSON Lines: one complete JSON value per line, with no commas between lines and no surrounding array. Switch to JSON Lines and every line is checked on its own, with a list of the lines that fail and why. Blank lines are skipped.
The most common JSON errors
| Error | Example | Fix |
|---|---|---|
| Trailing comma | [1, 2,] | Remove the last comma |
| Single quotes | {'a': 1} | Use double quotes: {"a": 1} |
| Unquoted key | {a: 1} | Quote the key |
| Comment | // note | Remove it; JSON has no comments |
| Python literals | True, None | Use true, null |
| Raw line break in a string | "line 1↵line 2" | Write \n |
To fix formatting as well as find errors, use the JSON formatter. To check that valid JSON has the right shape (required fields, types, allowed values), use the JSON Schema validator.
FAQ
How do I check if JSON is valid?
Paste it into the box above. The validator checks it as you type and shows “Valid JSON” with a summary of the structure, or the exact line and column of the first error with a suggested fix.
Why does my JSON say “Unexpected token”?
The parser found a character it did not expect at that position. The usual causes are a trailing comma, single quotes, an unquoted key, a comment, or a missing comma between two values. The hint under the error names the likely cause.
Are duplicate keys valid JSON?
The JSON standard says keys should be unique but does not forbid duplicates, so most parsers accept them. They behave differently, though: JavaScript keeps the last value, while some parsers keep the first or reject the document. Treat duplicates as a bug.
Can I validate a JSON Lines or NDJSON file?
Yes. Choose JSON Lines and each line is validated separately. You get a count of valid lines and the line number, column and reason for each invalid one.
Is a single number or string valid JSON?
Yes. Since RFC 7159 (2014), any JSON value can be the whole document, including "hello" or 42. A few older parsers and APIs only accept an object or array, so the validator mentions it.
Is my data sent to a server?
No. Validation runs entirely in your browser.