JSON Validator
Check a JSON payload, and when it fails, see the line, the column and the reason.
What this tool does
JSON Validator reads your input with a scanner written for this tool rather than handing it to the browser's own parser, because engines report failures in whatever wording they please and often without a position you can act on. This one stops at the first thing that is not valid JSON and gives you the line, the column, a plain-language reason, and an excerpt of the offending line with a caret under the character where the scan gave up. Several reasons are spelled out in full: a single-quoted string where a value belongs, a raw control character inside a string, a \u escape without four hex digits, an unknown backslash escape, a string that never closes, and the literal -Infinity. Other JavaScript habits — a bare NaN, a hexadecimal number, a leading plus, a leading zero — stop the scan at the right character, but the wording falls back to naming the character that was not expected there.
When the document does parse, the report is a set of counts rather than a copy of your data: the top-level type, how many objects, arrays, strings, numbers, booleans and nulls it holds, the deepest level of nesting, and the size of the input measured in UTF-8 bytes. Two things an ordinary parse would hide are called out separately. Property names repeated inside the same object are listed by path and line, because only the last value of each survives. And every integer literal that does not survive the round trip through a 64-bit float is shown beside the value it actually reads back as, with the first twenty listed.
Everything happens in this browser tab: the payload is never sent anywhere, so a response carrying access tokens, internal hostnames or customer records stays where you pasted it. The limits are worth knowing before you lean on the verdict. This checks syntax, not meaning, so it has no opinion on whether a required field is present or a value has the type your schema expects. It reports one error at a time, because the scan stops at the first one — duplicate keys in a document that also has a syntax error stay hidden until the syntax error is gone. A byte-order mark is skipped as whitespace wherever it turns up, not only at the start, so a file this calls valid can still be refused by a stricter reader. Nesting deeper than 512 levels is treated as an error rather than followed.
How to use it
- Paste a payload. Drop the JSON into the input box, or press Load sample for a document that is deliberately broken: it carries both a duplicate key and a trailing comma.
- Decide what counts as an error. Comments and trailing commas fail by default, which is what strict JSON requires. Tick the JSONC option to read tsconfig-style files where both are normal — on the sample, that is also what reveals the duplicate key, since the scan otherwise stops at the trailing comma first.
- Leave duplicate key reporting on. It is on by default and costs nothing. Switching it off only hides them from the report, since the scan collects them either way.
- Run it and read the report. A valid document produces the counts table; an invalid one names the line, column and reason. Copy output takes the plain-text version of whichever you get.
Processing & privacy
Runs on your device. Your file is processed directly in this browser.
Common use cases
A config file your build tool rejects
Tooling often reports a JSON parse error with no position at all, or with an offset counted in bytes. Pasting the file here gives you a line and a column.
An API response with a repeated field
Two properties sharing a name parse without complaint and the second quietly wins. The report names the path and the line of each occurrence.
Database identifiers sent as numbers
A nineteen-digit ID does not survive a 64-bit float. The report shows the literal beside the value it reads back as, which is the argument for quoting it.
Checking a hand-edited .jsonc file
Turn the tolerant option on and the comments and trailing commas in a tsconfig or an editor settings file stop being reported as failures.
Questions
Does my JSON leave the browser?
Why does it reject my tsconfig.json?
Is this a JSON linter?
Why does it report only one error?
Does it check my JSON against a schema?
Why do duplicate keys matter if the document is valid?
The error points into one enormous line — what am I looking at?
Does it fix or reformat anything?
How large a payload can it handle?
Can I use it with the network switched off?
Related tools
- JSON Formatter — Pretty-print, collapse and inspect JSON instantly.
- Base64 Encoder Decoder — Encode and decode Base64 text and files.
- JWT Decoder — Inspect the header, payload and claims of a JWT.
- Hash Generator — Compute MD5, SHA-1, SHA-256 and SHA-512 digests.
- Regex Tester — Test patterns against sample text with live matches.
- Unix Timestamp Converter — Convert between epoch seconds and readable dates.