JSON Validator

Check a JSON payload, and when it fails, see the line, the column and the reason.

Runs on your deviceDeveloperWorkingNo account needed

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

  1. 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.
  2. 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.
  3. 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.
  4. 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?
No. The scan runs in this tab and the payload is never transmitted, logged or stored. The page does count the visit, but that request carries only the tool's name — never a byte of what you pasted.
Why does it reject my tsconfig.json?
Strict JSON has no comments and no trailing commas, yet files named .json across tooling ecosystems routinely contain both. Tick the JSONC option and they are accepted.
Is this a JSON linter?
In the sense people usually mean by a JSON lint, yes: it parses strictly, points at the exact character that broke, and flags duplicate keys. It does not enforce a house style, reorder keys or rewrite the file.
Why does it report only one error?
The scanner stops where it can no longer tell what was intended, because everything after an unclosed bracket is guesswork. Fix what it names, run it again, and it moves on to the next real problem.
Does it check my JSON against a schema?
No. This is a syntax check plus the two things a plain parse hides: duplicate keys and rounded integers. Whether a field is required, must be a string, or must be one of five permitted values is a question for a JSON Schema validator, which this is not.
Why do duplicate keys matter if the document is valid?
JSON permits them and a parser keeps only the last value without warning, so a config that defines the same setting twice looks correct while using the one you did not mean.
The error points into one enormous line — what am I looking at?
Minified payloads are a single line, so the excerpt is a window rather than the whole thing: up to 100 characters taken from that line, with as many as 39 characters of run-up before the caret, which sits under the exact character.
Does it fix or reformat anything?
No, the output is a report rather than a document. Use JSON Formatter to indent a valid payload, or JSON Minifier to strip the whitespace back out.
How large a payload can it handle?
Nothing in the page caps the input. The document is held in memory twice over, as text and as the parsed value, so a few megabytes is comfortable and much more will make the tab sluggish while the scan runs.
Can I use it with the network switched off?
Once the page is open, yes — the scan itself never needs the network. There is no offline cache, though, so loading the page in the first place does require a connection.

Related tools