TheJSON

JSON Validator

Validate JSON as you type. Errors show the exact line, column, and a plain-English explanation.

Common JSON errors this validator catches

  • Trailing commas before } or ]
  • Single-quoted strings or unquoted property names (valid JavaScript, invalid JSON)
  • undefined, NaN and Infinity
  • Unescaped newlines or control characters inside strings
  • Leading zeros, dangling decimal points, and invalid escape sequences
  • Extra content after the JSON value, such as two objects pasted back to back
  • Comments, which the JSON specification does not allow

How validation works

TheJSON uses its own strict parser that follows RFC 8259, so anything it accepts will also be accepted by JSON.parsein JavaScript, json.loads in Python and every other standards-compliant library. When parsing fails, the error message names the token that was found, what was expected instead, and the exact position. Click the message to jump the cursor there.

Like every tool on TheJSON, this runs entirely in your browser. Nothing you paste is uploaded, logged or stored on a server, so it is safe to use with API responses that contain tokens or customer data.

Frequently asked questions

Why is my JSON invalid when it works as a JavaScript object?

JSON is stricter than JavaScript. Keys must be double-quoted strings, single quotes are not allowed, trailing commas are forbidden, and values like undefined, NaN or comments have no JSON representation.

Does this validate JSON against a schema?

This page checks syntax only. To describe the expected shape of your data, generate a JSON Schema from a sample with the JSON Schema generator and validate against it in your test suite.

Is a single string or number valid JSON?

Yes. Since RFC 7159 any JSON value, including "hello", 42, true or null, is a valid document. Older tools that require an object or array at the root are following the obsolete RFC 4627.

Related JSON tools