Toolsel

JSON Validator

Runs in your browser

Check whether JSON is valid, with the exact line and column of any error.

JSON

What is a JSON Validator?

JSON's grammar is small but strict: keys must be double-quoted strings, trailing commas are not allowed, and single quotes, comments, and unquoted keys — all valid in JavaScript object literals — are not valid JSON at all. A validator checks input against that exact grammar and reports the first place it breaks down.

This differs from a formatter in what it optimises for. A formatter assumes your JSON is basically fine and re-prints it; a validator's whole job is telling you clearly whether it is fine, and if not, exactly where to look. Alongside pass/fail, it summarises the document's shape — how many objects and arrays it contains, how deeply nested it goes — which is often the fastest way to spot that a response has an extra nesting level you weren't expecting.

How to use it

  1. Paste your JSON into the input panel.
  2. The status badge updates immediately: green for valid, red for invalid.
  3. If invalid, the line and column of the problem is shown directly beneath the badge.
  4. If valid, review the structure summary — type, key count, nesting depth — to sanity-check the shape of the document.

Examples

Invalid — trailing comma

Input
{"id": 1, "name": "Ada",}
Output
Invalid — line 1, column 26: Unexpected token '}'

Valid

Input
{"id": 1, "name": "Ada"}
Output
Valid JSON — object, 2 keys, depth 1

Frequently asked questions

What is the most common reason JSON fails validation?
A trailing comma after the last item in an object or array. It is valid in JavaScript but not in JSON, and it is easy to leave behind after deleting the last field during editing.
Does valid JavaScript mean valid JSON?
No. JSON is a strict subset of JavaScript object/array syntax. Unquoted keys, single-quoted strings, comments, trailing commas and functions are all valid JavaScript but all invalid JSON. If you copied an object literal straight out of .js source, it usually needs cleanup first.
What does "depth" mean in the structure summary?
How many levels of nested objects or arrays the document contains, counting the root as depth 1. A flat object like `{"a": 1}` has depth 1; `{"a": {"b": 1}}` has depth 2. It is a quick way to sanity-check whether a response is nested the way you expected.
Can I fix the error here directly?
This tool focuses on telling you precisely where the problem is; edit the text in the input panel and the status re-checks live. For reformatting once your JSON is valid, use the JSON Formatter.