go-supertools
Developer & Data Tools

JSON Validator

Check whether text is valid JSON and see the parser error if it is not.

Runs in your browser Your input never leaves your device.

0 characters | 0 words
—

Report a problem with this tool

About this tool

Paste JSON to check whether it is valid. The tool runs your text through the browser's JSON parser and tells you "Valid JSON" or shows the error message. It does not reformat or fix the data; use the JSON beautifier for that. Checking happens in your browser as you type and nothing is uploaded. The wording and position details of error messages come from your browser, so they can differ between Chrome, Firefox and Safari.

How to use it

  1. Paste your JSON into the box.
  2. Read the verdict below.
  3. If it is invalid, use the error message to find the problem and edit your text.

Example

Input
{"name":"Ada","age":36}
Result
✓ Valid JSON.

The JSON syntax rules it checks

Strings and keys
Must use double quotes. Inside a string, a quote or backslash must be escaped with a backslash, and a raw line break is not allowed.
Values
Only strings, numbers, true, false, null, objects and arrays. undefined, NaN, Infinity and functions are not JSON.
Numbers
No leading zeros (07), no leading plus sign, no hex (0x1F), and a decimal point needs digits on both sides (.5 and 5. are invalid).
Commas
Between items only. A trailing comma after the last item is an error.
Top level
Any single value is valid, including a bare string, number or null. Two values side by side are not.

Valid JSON is not always the right JSON

This tool checks syntax only. Valid JSON can still have the wrong fields or types for the program reading it. To check structure, use the JSON Schema Validator with a schema. For structured data in web pages, the JSON-LD Validator checks schema.org markup. To make valid JSON readable, use the JSON Beautifier.

Reading the error message

The message comes from your browser's own JSON parser, so the wording differs between browsers. Most give a character position, a line and column, or both. The real mistake is often just before that point: a missing comma or closing quote is only noticed when the parser reaches the next character.

Common problems

Trailing comma error
JSON does not allow a comma after the last item in an object or array. Remove it.
Single quotes or unquoted keys
Strict JSON needs double quotes around keys and strings. {'a': 1} and {a: 1} are invalid.
Comments or special values
JSON has no comments, and values like undefined or NaN are not allowed. Remove them or use null.

Frequently asked questions

Does it accept JSON5 or JSON with comments?

No. It checks strict JSON. Comments, single quotes, unquoted keys and trailing commas, which JSON5 allows, are reported as errors.

Does it detect duplicate keys?

No. The browser's parser accepts an object with the same key twice and keeps the last value, so such text is reported as valid.

Is my JSON uploaded?

No. It is checked in your browser as you type.