What validation checks
A JSON document is valid when it follows the grammar in RFC 8259. This validator checks every rule of that grammar:
- There is exactly one value at the top, and nothing after it.
- Objects use
{ }with double quoted names, a colon after each name, and commas between members and no comma after the last. - Arrays use
[ ]with commas between items and no comma after the last. - Strings use double quotes, contain no raw line breaks or tabs, and use only the escapes
\" \\ \/ \b \f \n \r \tand\uXXXX. - Numbers have no leading zeros, no leading plus sign, and a digit on both sides of a decimal point.
- The only literals are
true,falseandnull, in lowercase. - There are no comments.
Beyond the grammar it adds warnings for things that are legal but risky: duplicate property names in one object (the RFC says names should be unique, and parsers disagree about which value wins), and numbers that a JavaScript program would round.
What a syntax check cannot tell you
Valid JSON is not the same as correct JSON. This tool does not know what your document is supposed to contain, so it cannot tell you that an email field is missing, that age is a string instead of a number, or that an API will reject the request.
To check structure and types you need a JSON Schema and a validator that reads it. Run the syntax check first, because a schema validator cannot start until the text parses.
JSON that works in JavaScript but is not valid JSON
Most invalid JSON is really a JavaScript object literal. JSON came from that syntax but kept a much smaller part of it:
- Unquoted names, as in
{name: "Ann"}, are not allowed. Names need double quotes. - Single quoted strings are not allowed.
- Trailing commas, such as
[1, 2, ], are not allowed. - Comments are not allowed.
undefined,NaNandInfinityare not JSON values.- Hex numbers such as
0xFF, and numbers such as.5or5., are not allowed.
If your data uses some of these on purpose, it is probably JSONC or JSON5. Turn on the relaxed option to read comments and trailing commas. The result then says it is valid only as relaxed JSON.
Reading the report
The report describes the document you pasted. Nesting depth counts how many arrays and objects are open at the deepest point. Property names counts every key in every object, including repeated ones. Size is the number of bytes the text takes in UTF-8, which is what a file or a request would carry.
A Warnings count above zero does not make the JSON invalid. The notes under the report list each one with its line and column.