JSON Validator

Check whether JSON is valid and see the exact error position if it is not, so you can fix it fast. Free to use and private.

Input
Result

About JSON Validator

The JSON Validator checks whether your JSON is valid and, if not, shows exactly where the problem is. Catch errors before you send data to an API or save a config file.

Usual culprits

A trailing comma after the last item, single quotes instead of double quotes, keys without quotes, and brackets that do not match.

Fix the first error first

The parser stops at the first problem, because everything after it is unreliable. Fix it and check again.

Valid is not the same as correct

Validation checks the JSON grammar, not whether the data makes sense for your app. For structure checks, use the JSON Schema Validator.

Share safely

Tokens, passwords and personal details often hide in config files and API responses. Remove them before sharing an example.

Private

Everything runs in your browser. Your code and data are not uploaded.

How to use JSON Validator

  1. Paste your JSON or open a file.
  2. Read the validation result.
  3. Fix the error shown and check again.
  4. Copy the valid JSON when you are done.
  5. If you have a very long document, work on one section at a time: validate the whole file once, then validate the section the error points to after you fix it.

Related guide: How to Format and Validate JSON (With Common Errors Explained)

Help & FAQ

What are the most common JSON mistakes?

Trailing commas after the last item, single quotes around strings, unquoted property names, comments and missing commas between items.

Is JSON the same as a JavaScript object?

No. JSON is stricter: keys must be in double quotes, strings use double quotes, and functions, comments and undefined are not allowed.

Can it validate against a schema?

Use the JSON Schema Validator to check data against a schema.

Does it also format our JSON?

This tool only checks validity. To make valid JSON readable, use the JSON Formatter.

Can we validate a large file?

Yes, as far as your device memory allows. Open the file instead of pasting if it is very large.

Why does our JSON fail when it looks right?

Check for characters that look normal but are not: curly quotes, a non-breaking space, or a byte order mark at the start. Retype the quotation marks around the key or value named in the error and validate again.

Does valid JSON mean our API will accept it?

Not necessarily. The API may expect different field names, types or required fields. Valid JSON only means the syntax is correct; use a JSON Schema if the receiving system publishes one.

Can JSON contain comments?

No. The JSON specification has no comment syntax, so a comment makes the document invalid. Remove comments before validating, or use a format that allows them, such as JSON5 or YAML, and convert afterwards.

What is the difference between validating and formatting?

Validating checks that the syntax is correct. Formatting only adds indentation and line breaks to valid JSON. Use the JSON Formatter if you want the readable layout as well as the check.

More in Developer Tools

See all 39 in Developer Tools