Skip to content

JSON validator

Checks whether the JSON parses. The text in the editor is not rewritten.

Ctrl+Enter or ⌘+Enter runs this tool immediately.

JSON to check

Waiting for input.

Parsing stays in this browser. Input is not uploaded or saved.

How to use this tool

  1. Paste JSON, or load the sample. It is valid but repeats a key, so the duplicate notice is visible.
  2. Read the validation panel. An error names the line and column where the parser stopped.
  3. Fix the text yourself. The validator never rewrites or repairs the input.

Supported formats and limitations

  • This checks syntax against the JSON standard. Comments, trailing commas, and single quotes are errors.
  • A duplicate key is reported as a notice, not an error, because the JSON standard allows it. Most parsers keep only one of the values.
  • It does not check a schema. Use the JSON Schema validator to check required fields and types.
  • Integers past ±(2^53 − 1) are valid JSON but are reported, because JavaScript reads them imprecisely.

Examples

A trailing comma

The comma after the last value is invalid JSON. The error points at the closing brace.

{
  "a": 1,
}

A duplicate key

This parses, but only one value of name survives. The panel names the line of the second key.

{"name": "a", "name": "b"}

Common errors and solutions

Expected double-quoted property name
Remove the trailing comma, or put the key in double quotes.
Expected ',' or '}' after property value
Add the missing comma between the two properties.
Unexpected end of JSON input
A bracket or quote is not closed. Check the end of the document.

FAQ

Is a duplicate key invalid JSON?
The standard says keys should be unique but does not forbid repeats. JavaScript keeps the last value and some other parsers keep the first, so the validator reports it.
Why does my tsconfig.json fail?
tsconfig.json allows comments and trailing commas. Strict JSON does not, so a strict validator rejects it even though TypeScript reads it.
Is the JSON uploaded?
No. The check runs in your browser on the text in the editor.

Read next

Related tools

  • JSON formatter

    Validate JSON, then pretty-print it with 2 or 4 spaces or minify it. Invalid JSON produces an error and leaves the output empty.

  • JSON Schema validator

    Check a JSON document against a JSON Schema in the browser. Draft-07 and 2020-12 are supported, and remote $ref values are not fetched.

  • JSON minifier

    Minify JSON in the browser by removing whitespace and line breaks. Values are unchanged, and the size saving is shown.