JsonBro

JSON validator with readable errors

Most validators tell you Unexpected token } in JSON at position 1247. That is the parser's point of view, not yours. This one translates the error, attaches it to a line, and suggests the fix.

Open the editor →

What the messages actually say

The parse error is diagnosed before it is reported, so the message describes the cause rather than the symptom:

What is wrongWhat you are told
["a" "b"]Missing comma between array items, or an unclosed ]
{'a': 1}Strings and keys must use double quotes
{a: 1}Object keys must be quoted
{"a": 1,}Trailing comma before the closing brace
A document cut shortThe document ends before it is complete

The report waits for a pause in your typing before appearing, because a document is invalid for most of the time you are editing it and a banner reacting to every keystroke is noise. It shows as a small chip naming the line; hovering it reveals the explanation and the repair action.

Duplicate keys: valid JSON that loses data

{"a": 1, "a": 2} parses successfully in every JSON implementation, and one of those values disappears. Because the document is technically valid, most validators say nothing at all. This one flags duplicate keys explicitly, naming them, so you find out before the missing field becomes a bug somewhere else.

Automatic repair

When the problem is mechanical, repair is offered inline: trailing commas, single quotes, unquoted keys, comments, and the curly quotes that arrive when JSON has been through a word processor or chat client. Repair rewrites only what it must, and you can undo it. Above 2 MB the repair check is skipped rather than allowed to block the editor, and the report says so instead of pretending.

Questions

What does "Unexpected token" actually mean?

It means the parser found a character that cannot appear where it appeared — most often a missing comma, an extra comma, an unquoted key, or a quote that was never closed. This validator names the specific cause instead of reporting the raw token.

Is JSON with comments valid?

No. JSON has no comment syntax, so // and /* */ make a document invalid — even though many tools accept them. Repair can strip comments so the result validates.

Are duplicate keys allowed in JSON?

The specification permits them but says the behaviour is undefined; in practice parsers keep the last one and discard the rest, silently losing data. This validator flags them.

Does validation happen on a server?

No. Validation runs in a Web Worker inside your browser, so large documents do not freeze the interface and nothing is transmitted.

Try it with your own JSON →