Validate JSON online

Paste your JSON: validity is checked instantly, and errors are located for you.

๐Ÿ”’ Validated locally by your browser's own engine โ€” your JSON is never uploaded.

The trailing comma, and the other usual suspects

Four mistakes account for almost every invalid JSON file. The trailing comma after the last element โ€” legal in JavaScript, forbidden in JSON, and the reason the example on this page fails. Single quotes instead of double ones. Unquoted keys, again borrowed from JavaScript habits. And comments, which JSON simply does not have.

The validator points at the position where parsing broke. That position is where the parser gave up, which is usually one character after the actual mistake โ€” look just before it.

Validated by the engine that will actually read it

This tool does not reimplement a JSON parser. It hands your text to JSON.parse, the same engine your browser and your Node server use. So a file this page accepts is a file they will accept, and the error message you get is the real one rather than an approximation.

Frequently asked questions

Why is a trailing comma rejected?

Because the JSON specification does not allow it, even though JavaScript does. Remove the comma after the last element of an array or object.

Can JSON contain comments?

No. If you need annotations, add a regular key such as "_comment", or use JSON5 or YAML instead.

Does it check my data against a schema?

No, it validates syntax only. Checking that fields match an expected structure is a different job.

Is my JSON uploaded?

No. Validation happens entirely in your browser.

Related tools