JSON Validator

Paste JSON to check it, see the exact line and column of any error, then format, minify or copy it.

input.json
Validation runs as you type, in your browser. Nothing is uploaded.

What makes JSON invalid

JSON is stricter than JavaScript object syntax. One stray character stops the whole document from parsing, so these rules all have to hold:

  • Keys and strings use double quotes: {"name": "value"}, never single quotes or bare keys.
  • Commas go between items only. A comma before ] or } is an error.
  • There are no comments, neither // nor /* */.
  • The literals are lowercase true, false and null.
  • Numbers are plain decimals: no NaN, Infinity, leading zeros, leading + or hex.
  • Inside strings, a backslash starts an escape (\n, \", \u00e9), and raw tabs or line breaks are not allowed.
  • A document holds exactly one top-level value.

Common JSON errors and how to fix them

FAQ

Is my JSON uploaded anywhere?
No. Validation, formatting and minifying run in your browser, and the JSON you paste never leaves the page.
Why does my browser word the error differently?
The message shown is your browser's own JSON.parse error, and Chrome, Firefox and Safari each phrase it their own way. The line and column come from a separate check of the text, so they are the same in every browser.
Are comments or trailing commas allowed?
No. JSON5 and JSONC (used by some config files) allow them, but they are not JSON, and a JSON parser rejects both.
Are duplicate keys invalid?
RFC 8259 allows them, so the validator accepts them, but most parsers keep only the last value. Rename one of the keys if both values matter.
Does formatting change my numbers?
No. The formatter keeps the original text of every number and string, so 12345678901234567890 or 1.0 stays exactly as written.