formatjson.pro
Validate, pretty-print or minify JSON in your browser — nothing is uploaded.

Validate JSON Online

Paste your JSON below and press Validate only. If it parses, you get a green confirmation and the top-level type; if not, you get the exact line and column of the first error so you can fix it. Nothing is uploaded — it all runs in your browser.

What "valid JSON" actually means

JSON is stricter than it looks. A document is valid only if every one of these holds: strings use double quotes (never single), there are no trailing commas after the last item in an object or array, object keys are quoted strings, and there are no comments. Those four rules cause the large majority of "invalid JSON" errors.

How to read the error

When parsing fails, the validator reports the position of the first character the parser could not accept, translated into a line and column. The real mistake is usually just before that point — a missing comma, an unclosed bracket, or a stray quote on the previous token.

The usual culprits

{'name': 'Ada'} — single quotes are not allowed; use {"name": "Ada"}.

{"a": 1,} — the trailing comma after 1 is invalid.

{"a": 1 "b": 2} — a comma is missing between the two pairs.

{"note": "line1\nline2"} is fine, but a literal line break inside a string (pressing Enter) is not — newlines inside strings must be escaped as \n.

FAQ

Is my JSON uploaded anywhere?

No. The validator uses your browser's own JSON parser, so the text never leaves your device.

Why does it say 'unexpected token' when my JSON looks fine?

The most common causes are single quotes instead of double quotes, a trailing comma after the last item, or a missing comma between two items. The reported position points to where the parser gave up, so check the token just before it.

Can JSON have comments?

No. Standard JSON does not allow // or /* */ comments. If your file has them it is JSON5 or JSONC, not strict JSON, and must be stripped before parsing.