JSON Validator
Validate JSON and see every problem in one pass, not just the first. Catches trailing commas, single quotes, comments and duplicate keys.
Waiting for input
Paste a document to validate it.
Related tools
All Developer tools →This tool runs entirely in your browser. Nothing you enter is sent to our servers, so there is nothing for us to store or see.
About the JSON Validator
Paste JSON and find out what is wrong with it — all of it, in one pass, with a line and column for every problem.
That is the difference between this and wrapping JSON.parse in a try/catch, which is what most validators do. The built-in parser stops at the first error it meets, so a file with six trailing commas costs six rounds of fix, re-paste, and be told about the next one. This tool scans the whole document itself and reports every issue together, so one pass through the list fixes the file.
It knows the mistakes people actually make, and names them rather than reporting an unexpected token: trailing commas, single-quoted strings, unquoted keys, // and /* */ comments, and the None, True, NaN and Infinity that mean the text came out of a Python shell or a JavaScript console rather than a JSON encoder. It also flags two problems that parse perfectly but lose data: a key repeated in the same object, where only the last value survives, and an integer too large for JavaScript to hold exactly.
How to use the JSON Validator
-
Paste your JSON
Into the box, or drop a .json file onto it. Validation runs as soon as you stop typing.
-
Read the verdict
A valid document reports its size, depth, key count and top-level type. An invalid one lists every problem found.
-
Work down the list
Each issue gives a line and column, what is wrong, and usually why it happens. Errors must be fixed; warnings parse but change your data.
-
Fix and re-check
Correct the file and paste it back. Because every issue is reported at once, one round of edits is normally enough.
Frequently asked questions
Why does this find more errors than my editor?
Because most validators call the browser's JSON.parse and report whatever it complains about first, then stop. This one scans the document itself and keeps going past each problem, so you get the complete list in one pass instead of discovering them one edit at a time.
My JSON has comments and my editor accepts them. Is it valid?
No. The JSON specification has no comments at all, in either the // or the /* */ form. Several tools accept them anyway — VS Code's settings files and TypeScript config are JSONC, a different format — but a strict parser will reject the file. The usual workaround is a "_comment" key holding a string.
What is wrong with a duplicate key if it still parses?
Nothing at parse time, which is exactly the problem. The specification does not forbid it, and every mainstream parser keeps the last value and silently discards the earlier ones. So the document loads without complaint and quietly contains less data than it appears to. It is reported as a warning rather than an error for that reason.
Why is a long number flagged?
JSON allows numbers of any precision, but JavaScript stores them as 64-bit floats, exact only to about 15 or 16 digits. An identifier like 9007199254740993 becomes 9007199254740992 the moment it is parsed. Nothing warns you, and the value is simply wrong from then on. Quote large IDs as strings.
Is my JSON uploaded anywhere?
No. The scanner and the parser both run in your browser and nothing is transmitted or stored, which is what makes it safe to check a config file containing credentials or an API response containing customer records.