About the JSON Validator
The JSON Validator checks whether text is valid JSON the moment you paste or edit it. If something is wrong, it shows the line and column and highlights the problem in context; if it's valid, you can format or minify it and see its key count and nesting depth.
How it works
The text is passed to the browser's built-in JSON.parse every time it changes. If parsing succeeds, the input is valid JSON; if it throws, the error message is displayed. Browsers word these messages differently, and most include a position or line and column number.
This is a syntax check against the JSON standard. Any valid JSON value passes, including a bare number, string, true, false, or null. It does not check the data against a schema, and it does not warn about duplicate keys, which the JSON standard discourages but does not forbid.
How to use
- 1
Paste or type JSON into the box, or click Open file.
- 2
Check the message below: green for valid, red with the error location for invalid.
- 3
Fix the highlighted line, then use Format or Minify if you need to.
Worked examples
Valid object
A small settings object.
Single quotes
JSON copied from JavaScript code.
JSON requires double quotes for keys and strings.
Bare value
A lone number.
A top-level value does not have to be an object or array.
Frequently asked questions
What is a common cause of invalid JSON?+
Trailing commas after the last item are the most frequent, followed by single quotes, unquoted keys, and comments.
Does this tool fix errors automatically?+
No. It tells you what is wrong and where, so you can fix it. Once the JSON is valid, the Format button tidies the layout.
Is a single number or string valid JSON?+
Yes. Modern JSON allows any value at the top level, so 42 or "hello" are valid.
Can it validate against a JSON Schema?+
No. It checks syntax only.