The Paper Room

JSON Validator

Paste any JSON and instantly know whether it's valid. If it's not, the tool parses the error from JSON.parse and shows you exactly where the problem is — with the position in the string and a clear error message so you can fix the typo, missing comma, or trailing comma that's breaking your config file or API response.

When the JSON is valid, you get the formatted (pretty-printed) output ready to copy, plus useful stats: the number of top-level keys (for objects), the maximum nesting depth, and the approximate size in bytes. This is handy for quick sanity checks on API payloads, configuration files, and data exports.

Everything runs in your browser using the native JSON.parse — your data is never sent to a server. For larger structural work (reformatting, minifying, sorting keys), see the JSON Formatter tool.

By The Paper Room Editorial TeamDeveloper Tools

Frequently asked questions

What's the difference between this and the JSON Formatter?

The JSON Formatter focuses on pretty-printing and minifying valid JSON. This tool focuses on validation — giving you detailed error messages with positions when JSON is invalid, and stats (depth, key count, size) when it's valid. Use the Formatter when you know your JSON is valid and want to clean it up; use the Validator when you're debugging a syntax error.

Why does JSON.parse reject trailing commas?

The JSON specification (RFC 8259) does not allow trailing commas after the last element in an array or object. JavaScript and TypeScript allow them in source code, but JSON is a stricter format. Remove the trailing comma to fix the error.

Can this validate JSON against a schema?

No — this validates JSON syntax only (is it parseable?). JSON Schema validation (does the data match a specific structure?) is a separate concern that requires a schema definition. This tool checks that your JSON is well-formed, not that it conforms to a particular shape.

What does 'nesting depth' mean?

It's the maximum level of nested objects and arrays in your JSON. A flat object like {"a": 1} has depth 1; {"a": {"b": [1]}} has depth 3. Deep nesting can indicate overly complex data structures and can cause stack overflows in recursive parsers.