How to use the JSON Validator
Paste your JSON. You get a clear valid or invalid result, and for invalid JSON the parser message points to where it went wrong.
What makes JSON invalid
The most common mistakes are a comma after the last item in an object or array, single quotes around strings, keys without double quotes, comments, and values like undefined or NaN that JSON does not allow. A missing bracket at the end of a long file is another classic.
Valid is not the same as correct
A validator tells you whether the text is well formed JSON. It cannot tell you whether a field is missing, has the wrong type or uses a value your app does not expect. For that, use JSON Schema or the documentation of the API you are calling.
Reading the error message
When JSON is invalid, the parser stops at the first character it cannot accept and reports where. The wording differs between browsers and tools, but a message like expecting a string, number, null, true or false usually means a value is missing, often because of a trailing comma before a closing bracket. Fix that spot and validate again, because a second error can hide behind the first.
The rules of the JSON format
Keys must be strings in double quotes. Strings use double quotes, never single ones. Numbers cannot have leading zeros, and there is no undefined, NaN or Infinity. Comments are not allowed either. These rules keep JSON simple and language independent, so data written by one programming language can be read by any other.
Examples
- Valid JSON
Valid JSON. No syntax errors were found.
- A valid array
Valid JSON. No syntax errors were found.
Limitations and assumptions
Checks JSON syntax only. It does not check your data against a schema or an API’s rules.
Frequently asked questions
What makes JSON invalid?
Trailing commas, single quotes, unquoted keys, comments and missing brackets are the usual causes.
Does it validate against a schema?
No. It checks syntax only.
Can I pretty-print it?
Use the JSON formatter.
Is my data sent anywhere?
No, validation is local.