Skip to content

JSON Validator

Check whether a piece of text is valid JSON and locate the exact character where it goes wrong.

Processed locally in your browser

0 chars · 0 lines
The result will appear here.

What is JSON Validator?

A JSON validator answers one question: does this text follow the JSON grammar? Typical mistakes are trailing commas, single quotes, unquoted keys, comments, missing commas or an unterminated string.

This validator uses a strict RFC 8259 parser. On success it summarises the document (root type, number of keys, nesting depth, size, counts of each value type) and warns about duplicate keys or integers too large for JavaScript. On failure it names the problem, the line and column, and prints the offending line with a caret.

How does it work?

  1. Paste your JSON into the input area (or open a file).
  2. Read the status banner: green for valid JSON, red for an error.
  3. For an error, follow the line and column and the caret excerpt to find the mistake, then fix and re-check live.
  4. When valid, use the statistics to sanity-check the structure, then format or minify it with the sibling tools.

Common use cases

  • Checking a hand-edited configuration file before deploying it.
  • Debugging an API client that reports “Unexpected token” without saying where.
  • Verifying webhook or fixture payloads in a test suite.
  • Teaching or learning what is and is not allowed in JSON.

Examples

Try this input in the tool above:

Input
{"name": "Ada", "langs": ["en", "fr"], "meta": {"active": true, "score": 9.5}, "note": null}
Output
Root type: object
Top-level keys: 4
Total keys: 6
Nesting depth: 2
Size: 92 B (92 bytes)
Values: 2 objects · 1 arrays · 3 strings · 1 numbers · 1 booleans · 1 null

Privacy

JSON Validator runs entirely in your browser. The text or files you provide are processed on your device and are not uploaded, logged or stored on our servers.

Limitations

This checks syntax only. It does not validate against a JSON Schema, and it does not know whether your application accepts the fields.

Frequently asked questions

Why is my JSON with single quotes invalid?

The JSON standard only allows double-quoted strings and property names. Single quotes, unquoted keys, comments and trailing commas are JavaScript syntax, not JSON. JSON Repair can fix them automatically.

Is an empty object or a bare string valid JSON?

Yes. Since RFC 8259 any value, including "text", 42, true, null, [] or {}, is a valid JSON document. Only empty input is not.

What does the depth statistic mean?

It is the maximum nesting of objects and arrays: a scalar has depth 0, {} has depth 1, and {"a":{}} has depth 2. Very deep documents (over 2,000 levels) are refused for safety.

More tools in JSON & Data →