JSON Validator

Checks your JSON against the standard and points at the exact character that breaks it.

runs in your browserno uploadno sign-up

Paste JSON or load the sample to start.

Six ways JSON breaks — try each one

Pick a mistake, then flip between broken and fixed. The message is the live result from this page’s validator; underneath is what your browser’s own JSON.parse says, for comparison.

{
  "a": 1,
  "b": 2,
}
Trailing comma: remove the comma before }
line 4, column 1

JSON.parse: Expected double-quoted property name in JSON at position 22 (line 4 column 1)

JavaScript object literals allow a comma after the last item; JSON does not. It is the single most common JSON error, usually left behind after deleting the last line.

How validation works

The validator walks your text character by character using the JSON grammar from RFC 8259 and ECMA-404. The first place the grammar cannot continue is reported with its line, column and a reason written for humans — "Trailing comma: remove the comma before }" rather than "Unexpected token }".

Valid JSON can still hide problems, so it also warns about duplicate keys (the standard says names "should" be unique; most parsers silently keep the last one) and integers too large for JavaScript to represent exactly.

Validator vs JSONLint

JSONLint popularised online JSON checking. This validator does the same job with more specific messages, highlights the error in place, and never sends your data anywhere. If you want a second opinion on an error, the optional "Explain & repair" button asks an AI model to describe the problem and propose a corrected version, which is re-checked here before you see it as valid.

Frequently asked questions

What makes JSON invalid?

The most common causes are trailing commas, single quotes around strings or keys, unquoted keys, comments, NaN/Infinity/undefined values, leading zeros on numbers, and unescaped line breaks inside strings. The explainer above lets you try each one.

Is JSON valid if the top level is not an object?

Yes. Since RFC 7159 (2014) any JSON value — an array, string, number, true, false or null — is valid at the top level. Some very old parsers still require an object or array.

Are duplicate keys invalid?

Not strictly. RFC 8259 says keys SHOULD be unique, and behaviour with duplicates is unpredictable across parsers. That is why they are shown as warnings, not errors.

Does "Explain & repair" send my data?

Only when you click it. The pasted text (up to 12,000 characters) is sent to an AI model through Vercel AI Gateway to produce the explanation, and is not stored by FormatKit. Validation itself never leaves your browser.

Does this validate against a JSON Schema?

No — it checks syntax, not whether the data matches a schema. Schema validation needs the schema document as a second input and is a different task.