JSON Validator

Paste JSON to check that it's well-formed.

JSON Input
Paste JSON above to validate it.

What is JSON Validator?

A JSON validator checks whether a piece of text is syntactically correct JSON — properly quoted keys, matched braces and brackets, no trailing commas — and tells you immediately if it isn't, along with why.

It's the first thing to reach for when an API call fails, a config file won't load, or code that parses JSON throws an unexplained error — instead of scanning by eye for a missing comma, the validator points at the exact problem.

How to use it

  1. Paste your JSON into the input box.
  2. The status updates instantly as you type — no button to press.
  3. A green "Valid JSON" result also shows the root type, item/key count, nesting depth, and character count.
  4. A red "Invalid JSON" result shows the parser's exact error message.
  5. Use "Load valid sample" or "Load invalid sample" to see both states without typing anything.

How it works

The validator runs your input straight through the browser's built-in JSON.parse(). If parsing succeeds, the result is valid JSON by definition — there's no separate, looser notion of "valid" being applied.

If parsing throws, the validator surfaces the JavaScript engine's own error message and position, which is the same information you'd get from a JSON.parse() call failing in your own code.

Example

A common mistake — a trailing comma:

{"id": 1, "active": true,}
→ Invalid JSON — Unexpected token '}', ..."active": true,}" is not valid JSON

Frequently asked questions

Why is my JSON marked invalid when it looks fine?

The most common causes are a trailing comma after the last item, single quotes instead of double quotes, or an unquoted key — all valid in JavaScript object literals but not in strict JSON.

Does this check JSON Schema, or just syntax?

Syntax only — whether the text is well-formed JSON. It doesn't check values against a schema (like "age must be a number").

Can I validate a JSON file, not just pasted text?

Open the file in a text editor and paste its contents in — there's no file upload, by design, so nothing leaves your browser.

What does "depth" mean in the valid result?

How many levels of nested objects/arrays the JSON contains. A flat object like {"a":1} has depth 1; an object containing an array of objects has depth 3.

Is there a size limit?

No server-side limit — validation happens entirely in your browser, bounded only by available memory.