JSON validator

Find out instantly whether JSON is valid, and if not, exactly where and why it breaks.

Tier 0 · browser · unlimited
46 characters
Line3
Column24

What makes JSON invalid

JSON looks like JavaScript but is stricter. Keys must be in double quotes, strings too; single quotes are not allowed. A comma after the last item of an object or array is an error. Comments, undefined, NaN and numbers with leading zeros (007) are not JSON. Line breaks inside a string must be written as \n. Configuration files and API payloads edited by hand break on these all the time.

This validator applies the RFC 8259 grammar exactly and stops at the first problem, telling you the line, the column and what it expected.

Worked example

{
  "name": "Ada",
  "langs": ["en", "fr",],
}

fails at line 3, column 23: a trailing comma before ]. Remove it and the next error is the trailing comma at line 4, column 1. Fix both and the summary shows an object with 2 keys and depth 2.

How this works

The input is read once by a strict parser that follows RFC 8259. It checks each token as it goes: strings must be double-quoted with valid escapes and no raw control characters, numbers must not have leading zeros or a dangling decimal point, and only true, false and null are allowed as literals. When something unexpected appears, the parser reports the 1-based line and column and a short reason. Valid documents get a summary of the root type, number of keys and maximum depth. Everything runs in this tab.

Frequently asked

Is a single string or number valid JSON?

Yes. Since RFC 7159, any JSON value, not only an object or array, can be the root.

Are comments allowed in JSON?

No. JSONC and JSON5 allow them, but standard JSON does not, so they fail here.

Why does the column look off by one?

Columns are counted from 1, and emoji count as two code units, matching most code editors.

Is NaN or Infinity valid?

No. JSON numbers must be finite; serialise them as null or as strings.

Sources

Reviewed Oct 17, 2026 · test vectors fixtures/dev/json-validator/