JSON Validator

Paste JSON to check whether it is valid. When it isn't, the JSON validator points to the exact line and column and explains the fix in plain English.

Pasted JSON and local files are validated in your browser. From URL may use our server.
Checks syntax only (RFC 8259). To check data against a schema, use the JSON Schema Validator.
Checks as you type.

How to use the JSON Validator

  1. Paste JSON into the input box, or upload a .json file up to 5 MB.
  2. The check runs as you type. Press Validate to run it again at any time.
  3. Read the result: a success message with stats, or the error with its line, column, and a suggested fix. Press Format this JSON to open valid input in the formatter.

How it works

The validator uses a strict parser that follows RFC 8259, the JSON standard. It stops at the first error and reports where it is. These common mistakes get a plain-language explanation:

  • Trailing comma before } or ]
  • Single quotes instead of double quotes
  • Keys without quotes
  • Comments (// or /* */)
  • NaN, Infinity, or undefined as values
  • Unescaped control characters, such as a raw tab or line break inside a string
  • Missing comma between values
  • Unclosed bracket or brace

For valid JSON, the stats show the root type, the number of keys and values, the maximum nesting depth, and the size.

Examples

  • {"a": 1,} is invalid: there is a trailing comma before }. Fix: remove the last comma.
  • {'a': 1} is invalid: JSON strings and keys need double quotes.
  • {"a": [1, 2, {"b": null}]} is valid: the root is an object, and the maximum depth is 3.

Common JSON errors and how to fix them

ErrorInvalidValid
Trailing comma{"a": 1,}{"a": 1}
Single quotes{'a': 1}{"a": 1}
Unquoted key{a: 1}{"a": 1}
Comment{"a": 1 // note}{"a": 1}
NaN or undefined{"a": NaN}{"a": null}
Missing comma{"a": 1 "b": 2}{"a": 1, "b": 2}

Most of these come from copying a JavaScript object or a config file written in JSON5. Real JSON is stricter than JavaScript.

The guide to common JSON syntax errors and fixes shows how to correct these mistakes in context.

Limitations

  • Input is limited to 5 MB.
  • Only the first syntax error is reported. Fix it and the next one, if any, will show.
  • Duplicate keys are allowed by the standard, so they give a warning rather than an error.
  • The tool checks syntax only. To check data against a schema, use the JSON Schema Validator.

Read the guide

When the JSON will not parse

Pretty-print JSON that already parses, jump to the line and column when it does not, and open a tree when the document is too deep to scan as text.

Frequently asked questions

What makes JSON invalid?

The most common causes are trailing commas, single quotes, unquoted keys, and comments. JSON allows none of these.

Can JSON contain comments?

No. The JSON standard has no comment syntax. Formats such as JSON5 and JSONC allow comments, but standard parsers reject them.

Does this validate against a JSON Schema?

No. It checks syntax only. To check data against a schema, use the JSON Schema Validator.

Is my data private?

Pasted JSON and local files are processed in your browser. From URL first requests the address directly; if that fails, Utilza's server may receive the URL and fetch the public response. Processing then continues in your browser. Avoid URLs containing secrets; see the privacy policy for details.

Often used together with JSON Validator.