Check whether text is valid JSON per RFC 8259. Errors are pinpointed with line, column and a caret marker — plus warnings for duplicate keys and precision-losing numbers that parsers accept silently.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Validation that points at the problem
Most parsers fail with “unexpected token at position 847” — technically true, practically useless. This validator scans your input against the JSON grammar (RFC 8259) and reports the failure as a line, a column, the offending line printed with a caret under the exact character, and a plain-English reason: a trailing comma, single quotes, an unquoted key, an unescaped line break. It also flags two things that are legal but dangerous: duplicate keys (parsers silently keep only the last value) and numbers long enough to lose precision.
Worked example
Input:
{
"title": "Report",
"tags": ["a", "b",],
}Report:
✖ Invalid JSON
Line 3, column 20:
"tags": ["a", "b",],
^
Trailing comma before "]" is not allowed in JSONWhen to use it
- Debugging a request body an API rejected with 400 Bad Request.
- Checking hand-edited config files before deploying them.
- Verifying JSON produced by string concatenation or templates.
- Auditing documents for duplicate keys that silently lose data.
Limitations to know
- Syntax only: a syntactically valid document can still violate your API contract — that is the JSON Schema Validator’s job.
- One error at a time: the scanner stops at the first violation, since errors after it are usually side effects of the first.
Common errors this catches
- Trailing commas, single quotes, unquoted keys — the classics from hand-editing.
- Unescaped line breaks or control characters inside strings.
NaN,Infinity,undefined— JavaScript values that are not JSON.- Multiple top-level values (two objects pasted back to back).
How to use the JSON Validator
- Paste the JSON you want to check.
- Click "Validate JSON" — or just look at the live badge that validates as you type.
- If invalid, read the error: line, column, a caret pointing at the exact spot, and a plain-English reason.
- Fix the input and re-run until you get the green result.
Frequently asked questions
What makes JSON invalid?
The usual suspects: trailing commas, single quotes instead of double quotes, unquoted keys, missing commas or brackets, and raw line breaks inside strings. This validator names the exact problem and points at its line and column instead of a generic "unexpected token".
Are duplicate keys valid JSON?
Technically RFC 8259 does not forbid them, but parsers typically keep only the LAST value and silently drop the earlier one. This validator flags every duplicate as a warning — valid, but almost always a bug.
Are comments allowed in JSON?
No — standard JSON has no comment syntax. If your file has // or /* */ comments, it is JSON5 or JSONC (used by some config files), and a standard parser will reject it right where the comment starts.
Why does my API reject JSON this validator accepts?
The syntax can be valid while the CONTENT violates the API's contract — wrong types, missing required fields. Syntax is checked here; contract validation is the JSON Schema Validator's job.