✅ JSON Validator
Checks JSON syntax the moment you type, highlights the broken line, and explains in plain English what went wrong and how to fix it.
How to use the JSON validator
- Paste your JSON into the editor. It's checked on every keystroke; the page opens with a broken example so you can see what errors look like.
- If something's wrong, the bad line is highlighted in red and the status bar tells you the line, column and what went wrong in plain English. The "error location" panel shows the surrounding lines with a
^pointing at the exact character. - 💡 hints explain the usual suspects — trailing commas, single quotes, comments, unquoted keys — and how to fix them. try auto-fix repairs those common mistakes in one click.
- When the JSON is valid you get structure stats (key count, max nesting depth, counts by type) and warnings for things that are legal but risky, like duplicate keys or huge integers.
Need to indent or minify? Use the JSON Formatter. This page focuses on answering "why won't this parse?"
JSON syntax rules in one table
JSON (JavaScript Object Notation, RFC 8259) looks like a JavaScript object literal but is much stricter. Plenty of things that work in JS code are errors in JSON.
| Rule | ❌ Invalid | ✅ Valid |
|---|---|---|
| Keys are double-quoted strings | {name: 1} | {"name": 1} |
| Strings use double quotes only | 'smith' | "smith" |
| No trailing commas | [1, 2, ] | [1, 2] |
| No comments | // note | use a "_comment" key |
| Only six value types | undefined, NaN | null |
| No leading zeros or bare decimals | 007, .5 | 7, 0.5 |
| Line breaks inside strings must be escaped | (pressing Enter) | "a\nb" |
JSON has exactly six value types: object {}, array [], string, number, true/false and null. Dates are best sent as ISO 8601 strings like "2026-10-05T09:00:00Z", and very large integers (IDs) as strings.
How the line and column are found
Instead of relying on JSON.parse, whose messages differ between browsers ("Unexpected token } in JSON at position 87"), this validator walks the input character by character with its own parser that follows the JSON grammar exactly. That's how it can report the precise first point where the grammar breaks. Lines and columns start at 1; the column is the character position within that line.
Keep in mind that the place an error is detected can be after the actual mistake. A missing comma is reported at the quote of the next key, and an unclosed bracket is reported at the end of the file. The hints point you to "the end of the previous line" or "the bracket that was never closed" in those cases.
Warnings: valid but risky
- Duplicate keys —
{"a":1,"a":2}is technically allowed, but parsers disagree on the result and most silently keep the last value. - Integers above 253 (9,007,199,254,740,992) — JavaScript numbers are 64-bit floats, so larger integers get their last digits changed. Twitter/X and Discord IDs are sent as strings for this reason.
Auto-fix only removes comments, converts single quotes, quotes bare keys, converts True/False/None/undefined and drops trailing commas. Always review the result. Your JSON never leaves the browser.