JSON Validator and Syntax Checker
A validator that answers two questions a `JSON.parse` call cannot: exactly where the document stops being valid, and what a lenient parser would have quietly changed even when it succeeds.
JSON to validate
Validation report
2 syntax error(s)
1. line 1, column 63 (byte 62) — Trailing comma before "]" is not valid JSON.
Allowed in JavaScript array literals, rejected by strict parsers. Remove it or use the "Fix common issues" action.
2. line 1, column 75 (byte 74) — "2026-13-45" is not a JSON number.Where parsing stopped: line 1, column 63
…id": 2, "list": [1, 2, 3,], "when": 2026-13-45}Trailing comma before "]" is not valid JSON.
Allowed in JavaScript array literals, rejected by strict parsers. Remove it or use the "Fix common issues" action.
1 further error position(s) are listed in the report. They are usually consequences of this one.
Position-precise errors, plus the warnings that survive a successful parse
The parser is written against the RFC 8259 grammar rather than delegated to JSON.parse, so an error carries a byte offset, a line, a column, the token found, the set of tokens expected, and a short note naming the clause. For a two-megabyte single-line response, that is the difference between a five-minute fix and an afternoon.
A document can be valid and still be a problem. Duplicate member names, integers wider than the 53-bit mantissa, values that are NaN or Infinity in disguise, a leading byte-order mark, comments, and files of newline-delimited records all get flagged with the position and the consequence, not just a red cross.
The result panel reports the shape of the document — depth, member count, array lengths, the largest collection, whether the root is an array — so you can see whether a payload has the structure your code expects before you write against it.
What validation reports
- Every syntax error with line, column and byte offset
- Expected-versus-found token description
- Duplicate member name detection with both positions
- Unsafe integer detection above 2^53 − 1
- BOM, comment, single-quote and trailing-comma diagnosis
- NDJSON and JSON text sequence recognition
- Control characters and lone surrogates inside strings
- Depth, member, node and array-length statistics
- Structural outline of the document before and after the error
- Repair suggestion when the deviation is mechanical
How to validate JSON
- 1Paste the documentThe status banner updates on every change. A green banner means the grammar is satisfied, not that the values are safe — read the warnings too.
- 2Work down the diagnostics listErrors are ordered by position. Fix the first one and re-read: a single missing comma can produce a cascade of later errors that were never real.
- 3Check the statistics against your expectationDepth, member count and the largest array tell you whether you are looking at one record, a page of them, or a dictionary keyed by ID.
- 4Use the outline to find the pathThe structural preview shows keys down to a chosen depth, which is how you locate the field a schema or a JSONPath expression should target.
What each diagnostic means
| Diagnostic | Severity | Consequence |
|---|---|---|
| Unexpected token | Error | The grammar is violated at that offset; nothing parses until it is fixed. |
| Duplicate member name | Warning | Valid JSON, but JSON.parse keeps only the last value; one of the two is silently gone. |
| Integer above 2^53 − 1 | Warning | Valid JSON, but JavaScript arithmetic will round it. Quote the value or read it as a string. |
| Byte-order mark | Warning | Parses in browsers, rejected by many strict back-end parsers, including some JSON libraries. |
| Comments present | Error | Not JSON. It is JSON5 or a configuration dialect; convert before sending it to an API. |
| Trailing comma | Error | Allowed in JavaScript literals, forbidden by RFC 8259 §2. |
| One value per line | Info | NDJSON or an RFC 7464 JSON text sequence, not a single document. |
| Unescaped control character | Error | Characters below U+0020 must be escaped inside a string per RFC 8259 §7. |
Severity reflects the specification, not this tool: only Error rows make the document invalid JSON.
Frequently asked questions
Why is my JSON invalid when it parses in JavaScript?
Because the file is not JSON but a JavaScript object literal: unquoted keys, single quotes, trailing commas, comments, or values like undefined and NaN. eval tolerates those; a conforming parser must not. The validator names the exact offset where the divergence starts.
Is a duplicate key an error?
No — it is a warning. RFC 8259 §4 says names SHOULD be unique, which is advice, not a requirement, and the ABNF admits the duplicate. The practical risk is that every JSON.parse implementation you will meet keeps the last value, so the earlier one is lost. JSON Formatter prints both.
What is the biggest integer JSON can hold exactly?
JSON itself imposes no limit on digits. The limit comes from the reader: an IEEE-754 double represents integers exactly up to 9007199254740991, so the validator warns above that because most consumers are JavaScript, and beyond it the value should be a string.
Can it check my JSON against a schema?
No. This tool answers "is this well-formed, and what would a parser do to it". Structural validation against a contract is a different problem — use a JSON Schema 2020-12 validator such as Ajv for that; see the JSON guide.
Why does it say my file is NDJSON?
Because it contains several complete JSON documents separated by newlines, which is a valid log and transport format but not one JSON document. Wrapping the lines in an array is what the formatter offers; RFC 7468 defines the sequence form with a record-separator character.
Does it validate UTF-8 encoding?
It reports lone surrogates and unescaped control characters inside strings, and detects a leading BOM. For byte-level encoding checks on a response, look at the charset header and the content-encoding claim, then decode with the Base64 decoder.
What does the report contain beyond pass or fail?
Every diagnostic carries a line, a column and a byte offset plus the rule it broke, and errors after the first are listed too, in source order, with a note that fixing the earliest one is usually what removes the rest. Alongside the errors it reports what a successful JSON.parse hides: duplicate names, integers outside 2^53 − 1, a leading BOM, comments, and a file that is actually NDJSON.