Home/Tools/Developer Tools/JSON Validator

JSON Validator

Developer Tools

Validate JSON syntax and check for errors.

⚡ Instant🔒 Private, in your browser🆓 Free, no sign-up👥 For developers
Your data never leaves your browser. We do not store inputs.

What JSON Validator does

The JSON Validator checks JSON against the strict JSON standard and reports the exact line and column of the first error, with the offending line shown and a plain-English hint for common mistakes such as trailing commas, single quotes, unquoted keys and comments. Valid JSON is summarized by size and structure.

FV
Reviewed by the FreeToolsVerse team · Last updated · How we check our tools

Features and benefits

  • Validates as you type, with no button to press
  • Shows the line and column of the first error, the line itself with a caret and a plain-English tip
  • Summarises valid JSON: root type, number of keys, arrays, objects and nesting depth
  • Strict RFC 8259 syntax, so it catches trailing commas, single quotes, unquoted keys and comments

How to use JSON Validator

  1. Paste your JSON into the box
  2. Validation runs as you type; a green result means the JSON is valid
  3. If it is invalid, read the line, column and message, then fix the highlighted spot
  4. Use the JSON Formatter next if you want it beautified or minified

Who should use it

Made for developers. Typical uses:

  • Validating JSON before API deployment
  • Debugging malformed JSON data
  • Checking JSON configuration files for errors

Example

The text {"name":"Ada","tags":["a","b",],"active":true} is reported as invalid at line 1, column 31: Trailing comma is not allowed in JSON. The text {"a":1,"b":[1,2,{"c":null}]} is valid: the root is an object with 3 keys, 1 array and 2 objects, with a maximum depth of 3.

Limitations and accuracy

It checks syntax only, not whether the data matches an expected structure; use the JSON Schema Validator for that. It reports the first error, so fix it and re-check to find any others.

Accuracy: Output is tested against known inputs. For production code, review the result and run your own tests.

Expert Tip

Fix errors one at a time: the validator reports only the first problem. If your JSON came from a word processor, check for curly quotation marks, which are not valid in JSON.

Frequently asked questions

What are the most common JSON errors?
Trailing commas, single-quoted strings, unquoted property names, comments and undefined or NaN values. None of these are allowed in strict JSON, and the validator points to each with a fix suggestion.
Does it show where the error is?
Yes. It reports the line and column, shows the offending line with a caret under the problem, and describes what it expected.
Is my JSON uploaded?
No. Validation runs entirely in your browser.

JSON Validator: the complete guide

What the validator checks

The JSON Validator tests whether text is valid JSON under the strict standard (RFC 8259). It validates as you type, so there is no button to press. A valid document shows a green message with a summary of its structure. An invalid one shows the line and column of the first error, the line itself with a caret underneath the problem, a plain-English description and often a tip for fixing it. Nothing is uploaded: the check runs in your browser.

Error messages you may see

These come straight from the validator, using small test documents.

  • {"name":"Ada","tags":["a","b",],"active":true} reports line 1, column 31: Trailing comma is not allowed in JSON.
  • {'a':1} reports line 1, column 2: Property names must use double quotes, not single quotes.
  • {"a":1 reports line 1, column 7: Unexpected end of input: the object is missing its closing }.
  • [1,2,3 reports line 1, column 7: Unexpected end of input: the array is missing its closing ].

What a valid result shows

For valid JSON, the tool summarises the structure. For {"a":1,"b":[1,2,{"c":null}]}, it reports that the root is an object with 3 keys, 1 array and 2 objects, with a maximum depth of 3. That helps you check that a document is shaped as you expect, for example that an API response has an array where you thought it had an object. The "Load an example with an error" link fills the box with a document that has a trailing comma, so you can see the error display.

Why JSON is stricter than JavaScript

JSON looks like a JavaScript object but is far stricter. Property names and strings must use double quotes. Trailing commas, comments, single quotes, unquoted keys and the special numbers NaN and Infinity are all invalid. Numbers cannot have leading zeros, and only true, false and null are allowed as keywords. Many errors come from pasting a JavaScript object, a configuration file with comments, or text that was altered by a word processor, which replaces straight quotation marks with curly ones. The guide to common JSON errors goes through each case.

Validation levels

Syntax validity is the first level only. A document can be valid JSON and still be wrong for your purpose, for instance a missing required field or a string where a number is expected. To check structure against a definition, use the JSON Schema Validator. It also reports only the first error, so fix it and the validator moves on to the next. Read what validators catch and what they miss for the wider picture.

After it validates

Once the JSON is valid, the JSON Formatter makes it readable or compact, the JSON Minifier removes whitespace, the JSON Diff Checker compares two versions, and the JSON to CSV Converter turns an array of records into a spreadsheet. Very large documents depend on your browser's memory.

Learning resources

Explore more in Developer Tools, read the guides and articles, or see how we test our tools.

Share This Tool