JSON Validator

Paste JSON and instantly see if it's valid — with precise error messages and line numbers.

Waiting for input...

What does JSON validation do?

JSON (JavaScript Object Notation) is a widely used data format for APIs, configuration files, and data storage. A single misplaced comma, missing quote, or unmatched bracket can make an entire JSON document invalid, causing silent failures or cryptic errors in code. This validator parses your JSON using the browser's built-in JSON.parse() and reports exactly what went wrong — including the character position — so you can fix problems quickly without guessing.

Reading the error messages

When JSON is invalid, the error message shows the specific parse failure and, where possible, the position in the string where the error was detected. Common errors include unexpected tokens (usually a missing comma or colon), unterminated strings (a missing closing quote), unexpected end of data (the JSON is cut off), and duplicate keys (allowed by the spec but often unintentional). The character offset in the error can be matched against the line and column in a text editor to find the exact location.

Understanding the stats

When JSON is valid, the tool displays four quick stats: Keys counts all object property names across the entire document (useful for understanding schema size), Arrays counts all array instances, Max Depth shows how deeply nested the structure is (high values may indicate overly complex data), and Characters shows the total length of the input. A formatted preview with 2-space indentation is also shown so you can read the structure clearly.

Common JSON mistakes to avoid

The most frequent JSON errors are: trailing commas after the last item in an object or array (valid in JavaScript but not JSON), using single quotes instead of double quotes for strings and keys, including comments (JSON has no comment syntax), and using undefined or functions as values (not valid JSON types). If you're writing JSON by hand, using a validator before sending it to an API or saving it to a config file can save significant debugging time.