Free · runs in your browser
JSON Validator
Paste JSON and see at once whether it is valid. If it is not, you get the line and column where the parser stopped. The check runs in your browser.
Paste JSON above, or load the sample.
How validation works
The tool runs your text through the same parser your own code uses, JSON.parse. The verdict updates as you type or paste, so you do not need to press anything: the status bar below the editor turns green for valid JSON, or red with the error message.
What a validator does and does not check
| Checked | Not checked |
|---|---|
| Brackets, braces and quotes balance | That fields have the right type |
| No trailing commas or comments | That required keys exist |
| Strings are escaped correctly | That values are in an allowed range |
| Only legal value types are used | That keys are unique |
For a structural check, use a JSON Schema validator in your project. This page answers the earlier question: is the text JSON at all?
Common reasons JSON is invalid
- A comma after the last item in an object or array.
- Single quotes around strings or keys.
- Unquoted keys, comments, or JavaScript values such as
undefinedandNaN. - Raw line breaks or unescaped quotes and backslashes inside a string.
Each one is shown with a fix in Why JSON.parse fails: the 6 errors behind most invalid JSON.
A caution about large numbers
A valid document can still lose data when it is read. JavaScript parses numbers as 64-bit floats, so integers above 9,007,199,254,740,991 are rounded. Send very large IDs as strings.
Frequently asked questions
Does this validate against a JSON Schema?
No. It checks syntax only: whether the text is legal JSON under RFC 8259. Checking that fields have the right types or required keys needs a schema validator.
Why is JSON with duplicate keys reported as valid?
The JSON grammar allows repeated keys, and JSON.parse accepts them, keeping the last value. Many linters flag duplicates as a smell, but they are not a syntax error.
Is my data sent to a server?
No. The check runs in your browser using JavaScript's JSON.parse. Nothing is uploaded or stored.
Why does the line and column point after the real mistake?
The parser reports where it gave up, which is at or just after the problem. A trailing comma, for example, is reported at the closing brace that follows it. Look one token back.