Skip to content

JSON Validator - Check JSON Syntax Online

Check Whether JSON Is Valid

Paste or type JSON and it is checked as you go. Valid input shows a green "Valid JSON" message with a summary of the document: number of keys, maximum nesting depth, and counts of objects, arrays, strings, numbers, booleans and nulls. Invalid input shows the error from your browser's JSON parser and the line and column it refers to. Nothing is uploaded, so payloads with credentials or personal data are safe to paste.

The Errors You Will See Most

  • Trailing comma: {"a": 1,}. Remove the comma before } or ].
  • Missing comma between two properties or array items, often after adding a line to the middle of a file.
  • Single quotes: {'a': 1}. JSON only allows double quotes.
  • Unquoted key: {a: 1} is a JavaScript object, not JSON.
  • Comments: // and /* */ are not allowed. Strip them with the JSON minifier's JSONC option.
  • Unescaped characters in strings: a raw line break or tab inside a string, or a Windows path like "C:\Users", where \U is not a valid escape. Write "C:\\Users". Worse, "C:\new" is valid but contains a line break, because \n is an escape.
  • Python or JavaScript values: True, None, undefined and NaN are not JSON.

What the Validator Does Not Catch

Duplicate keys such as {"id": 1, "id": 2} are valid syntax, and most parsers silently keep the last value. Large integers are valid too, but many languages round anything above 253 when they read it. And valid syntax says nothing about whether the data has the fields an API expects; use the JSON Schema validator for that. Once your JSON is valid, the JSON formatter will tidy its indentation.

Related Tools

Frequently Asked Questions

What counts as valid JSON?
JSON as defined by RFC 8259 and ECMA-404: double-quoted strings and keys, no trailing commas, no comments, no single quotes, and only the values true, false and null. Numbers cannot have leading zeros (007), a leading + or a trailing dot, and NaN, Infinity and undefined are not allowed. The top level can be any value, so "hello" or 42 on its own is valid JSON.
Why does my JSON fail here when my app accepts it?
Your app is probably not reading strict JSON. JavaScript object literals, JSON5, tsconfig.json-style JSONC and many config loaders accept comments, trailing commas, single quotes or unquoted keys. JSON.parse, Python's json module, Go's encoding/json and most APIs do not, so a file that loads in your editor can still be rejected by a server.
Does the validator show where the error is?
Yes. You get the parser's message plus the line and column it points to. The reported spot is where the parser gave up, which is often just after the real mistake: a missing comma at the end of line 11 is reported at the start of line 12.
Can I validate against a JSON Schema?
Not on this page, which only checks syntax. Use the JSON Schema Validator to check required fields, types and formats against a schema.