JSON Validator

This JSON validator checks your JSON against the strict rules of the format and tells you plainly whether it passes — and if it fails, exactly where it breaks, so you can fix it in seconds.

1Paste your JSON
2Press Validate
3Read the verdict — or the exact error line

Private by design: 100% in your browser — nothing is uploaded, no sign-up. This tool runs entirely on your device.

How to use this JSON validator

Paste your JSON into the box — from an API response, a webhook payload, a config file or a database export — and press “Validate JSON”. If the document obeys every rule of the JSON format, you get a green verdict plus a small set of statistics: how many object keys and array items it contains, how many values there are in total, and how deeply the structure nests. Those numbers are more useful than they look. They let you confirm at a glance that a file was not truncated on its way to you, and that the list you expected to hold hundreds of records really does.

If the document is broken, the validator shows the parser's own description of the failure and, where the browser reports a character position, converts it into the line and column you should look at. Read that message together with the short list of usual suspects printed under it. In practice, nearly every failure is a missing comma, a trailing comma after the last item, single quotes where double quotes belong, a key typed without quotes, or a comment left in the text. Fix the named problem and validate again — the whole loop usually takes under a minute.

The Beautify button is there for the moment the verdict turns green: it re-prints the same data with tidy indentation so you can read the structure, and the result can be copied straight back into your editor or ticket. Nothing about the data changes — only the whitespace — so beautifying is always safe to do before sharing a payload with a colleague.

Example: catching a trailing comma

Press “Load broken sample” and the tool loads this short document:

{ "name": "Ada", "skills": ["math", "code",] }

It looks harmless, but the validator rejects it: there is a comma after "code", the last item in the array, and JSON forbids a comma with nothing after it. The error message names the position of the closing bracket, because that is where the parser, still expecting another value, gives up. Delete that one comma and the same text validates cleanly — a perfect miniature of the most common JSON bug in real projects.

Why the reported line is often one past the real mistake

Parsers read left to right and report the first character they cannot make sense of. A forgotten comma at the end of line 4 does not break anything on line 4 itself; the parser only notices on line 5, when a new key appears where a comma or a closing bracket should have been. That is why experienced developers treat the reported line as “start looking here and read upwards”. Nine times out of ten the actual slip — the missing comma, the unclosed string, the stray bracket — sits within the three or four lines above the reported one. The statistics view helps too: if a long file fails near its very end, a bracket was probably left open much earlier.

Valid, well-formed, and merely lucky

It is worth knowing what a validator does not promise. A document can be perfectly valid JSON and still be wrong for your application: a field named "emial" instead of "email" parses beautifully, and a price stored as the string "12.99" instead of the number 12.99 is legal JSON that may still break a checkout. Validation proves the syntax, not the meaning. Teams that need the second kind of guarantee usually add a schema — a separate description of the expected fields and types — and check documents against that as well. But syntax comes first: no schema tool, API or importer will even look at a document that does not parse, which is why a fast, honest validator is the right first stop whenever data changes hands and something stops working.

Frequently asked questions

What does a JSON validator actually check?

It runs your text through a strict JSON parser — the same rules every programming language applies. The parser confirms that brackets match, strings and keys use double quotes, items are separated by commas, and values are only strings, numbers, booleans, null, objects or arrays. If any rule is broken, the validator reports the first problem it finds.

Why does the error line not always show where the mistake is?

A parser reports where it got stuck, which is often a line or two after the real mistake. A missing comma on line 4, for example, usually surfaces as an error on line 5, where the parser meets a value it did not expect. Start from the reported line and read upwards — the actual slip is almost always just above it.

Is my JSON uploaded to a server for validation?

No. Validation runs in JavaScript inside your own browser, using the same parser your browser uses for web applications. Nothing is sent, stored or logged, so API responses, config files and payloads with private data are safe to paste here — the tool even keeps working offline once loaded.

What is the most common JSON error?

The trailing comma — a comma after the last item in an object or array — is the single most common cause. It is legal in JavaScript code, which is why people write it out of habit, but the JSON standard forbids it. Missing commas, single quotes and unquoted keys make up most of the rest.

Can this validator handle JSON with comments?

Strict JSON does not allow comments at all, so a document containing // or /* */ notes will be reported invalid — correctly, because most parsers in other languages would reject it too. If your file is JSONC (JSON with comments) used by editors like VS Code, remove the comments before validating it as plain JSON.

What do the statistics under the result mean?

For valid JSON the tool counts the object keys, array items and total values it found, and measures how deeply the document nests. These numbers are a quick sanity check: if you expected a list of 200 records and the count says 3 items, something was truncated long before validation.

What is the difference between this and the JSON Formatter?

This page answers one question — is it valid, and if not, exactly where does it break — and adds a one-click beautify for convenience. The JSON Formatter focuses on reshaping valid JSON: choosing indentation, sorting keys alphabetically and minifying. Many people validate here first, then format.

Why does a huge number lose digits after validation?

JavaScript stores numbers with about 15–17 significant digits. An integer longer than that — some database IDs and timestamps qualify — can be rounded when any browser tool parses it. The JSON is still valid; if those exact digits matter, keep such IDs quoted as strings in your data.

Can I validate JSON from a file instead of pasting?

Open the file in any text editor, select all and paste it here — that is all a file upload would do anyway, minus sending your data anywhere. Documents of several megabytes validate fine on a typical laptop or phone.

Related tools