JSON Syntax Validator & Auto-Repair
Paste malformed JSON and get the line, the column and what the grammar expected there. The repair pass handles the three shapes humans actually produce and will not touch a single character inside your string values.
- Location comes from a grammar walk. Several of the engine's own messages carry no offset at all — a trailing comma inside an array is one of them — so a validator that reads the error text can only locate some malformations. This one reports a line and column for every rejection.
- Repair does three things: removes trailing commas, quotes unquoted keys, converts single-quoted strings. It does not add comments,
NaN,Infinity, hex or leading zeros, because those are not JSON. A file full of them is a JavaScript object literal, andeval-ing it to "fix" that is an injection hole. - Duplicate keys are legal JSON and silently collapse.
{"a":1,"a":2}validates and reports one key; the count below tells you when the input had more names than the value has.
Frequently Asked Questions
Is my JSON private?
Yes. Parsing and validation happen in your browser. Your payload is never transmitted to a server, so it is safe to paste data you would not upload elsewhere.
Why does it say my JSON is invalid when another tool accepts it?
Most other tools are lenient. Strict JSON forbids trailing commas, comments, single quotes, unquoted keys, and NaN. JSONBeautify follows the spec, so it reports the exact position of the first violation instead of silently coercing your input.
Does minifying JSON break anything?
No, for valid JSON. Whitespace outside string literals is insignificant, so removing it is safe. Keep key order in mind if a consumer depends on it, since beautifying and re-minifying preserves order but reformatting tools are free to differ.