Skip to content
SyntaxSnap

JSON Validator

Check JSON against the standard and get a clear pass or fail. When it fails, you see every problem the validator can find, each with its line and column, instead of fixing one error at a time. One of our free JSON tools.

Input

…

Output

How to validate JSON

  1. Step 1

    Paste or open the JSON

    Paste it, drop a file, or load it from a URL with your browser. It is checked as you type.

  2. Step 2

    Read the result

    A green banner means valid JSON. A red one lists every problem with its line and column.

  3. Step 3

    Fix the problems

    Click a line number to jump to it, or use Fix common errors for commas, quotes, comments and literals.

Worked example

Three errors and one warning are reported in one pass. The duplicate port key is legal JSON, but a parser would silently keep 9090 and drop 8080.
Input: a hand-edited config
{
  "name": "billing-service",
  'region': "eu-west-1",
  "retries": 3
  "features": { "refunds": false, },
  "port": 8080,
  "port": 9090
}
Validator result
Invalid JSON · 3 problems found

error    3:3   Strings must use double quotes, not single quotes.
error    5:3   Missing comma between properties.
error    5:33  Trailing comma before }. Remove the last comma.
warning  7:3   Duplicate key "port". JSON.parse keeps only the last value.

What makes JSON valid

JSON is defined by RFC 8259, and it is stricter than the JavaScript it came from. Keys and strings need double quotes. Commas separate items but may not follow the last one. There are no comments. The only literals are true, false and null, all lower case, so True, None, undefined, NaN and Infinity are all errors. Numbers cannot have a leading plus sign, leading zeros such as 007, a bare decimal point such as .5 or 5., or hexadecimal digits. Inside strings, a line break or tab must be written as \n or \t, and a backslash may only start one of the defined escapes.

Every problem, not just the first

Most validators stop at the first error because that is where the parser gives up. This one uses its own checker that understands the common mistakes and steps over them: after a missing comma, a comment, a single-quoted string or a trailing comma it carries on and keeps looking. You get the whole list in one pass, and clicking a line number puts your cursor on the problem. When it meets something it cannot safely step over, such as a string that is never closed or a bracket where a value should be, it stops there rather than guessing and filling the list with follow-on errors.

Warnings: duplicate keys

An object with the same key twice is technically allowed, because the standard says names should be unique rather than must. In practice every common parser keeps the last value and silently drops the others, so a duplicate usually means lost data or a merge mistake. The validator lists each repeated key as a warning, and the banner stays green, because the document will parse.

JSONC and JSON5 files

Files such as tsconfig.json, .eslintrc.json and VS Code's settings.json are JSONC: JSON with comments and trailing commas. Tick Allow comments (JSONC) to validate them as such; comments, trailing commas and single-quoted strings are then accepted and everything else is still checked. Leave it off when the file will be read by a strict parser such as JSON.parse or Python's json module.

Valid is not the same as correct

A validator tells you the text is well-formed JSON. It cannot tell you that price should be a number or that email is required. To check the shape of the data, generate a schema from a good example with JSON to Zod, or convert an existing JSON Schema with JSON Schema to Zod or JSON Schema to TypeScript.

Questions and answers

Is this the same as JSONLint?

It does the same job: it checks your text against the JSON standard (RFC 8259) and tells you where it breaks. It also keeps going after recoverable problems, so you see every missing comma or stray quote in one pass instead of fixing them one at a time.

Does it validate against a JSON Schema?

No. This page checks that the text is well-formed JSON. To check that the data has the right fields and types, generate a schema with JSON to Zod or convert an existing JSON Schema with JSON Schema to Zod.

Why is a duplicate key only a warning?

The standard says object keys should be unique but does not forbid repeats, so JSON.parse accepts them and keeps only the last value. That silently drops data, which is why the validator points each one out.

What does 'Unexpected text after the JSON value' mean?

The input holds more than one JSON value, usually because several objects were pasted one after another, as in JSON Lines (NDJSON) logs. Wrap them in [ ] with commas between them, or click Fix common errors to do that for you.

Is my data sent anywhere?

No. The validator runs in your browser tab. Large inputs are checked in a Web Worker on your device, and nothing is uploaded or stored.

Related tools

All JSON & Schema tools

Next step

Need this built into your stack?

The team behind SyntaxSnap builds custom code generators, internal developer tools and API integrations.