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.