JSON Validator
Paste JSON and instantly see if it's valid. If not, the exact error location (line and column) is shown. Valid JSON displays type, key count, array length, nesting depth, and size.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is JSON Validator?
JSON validation means checking whether a string of text is valid JSON — whether it can be parsed by JSON.parse without throwing an error. The JSON specification (RFC 8259) has strict rules: strings must use double quotes, there are no trailing commas, no comments, and keys must be strings. Even a single character out of place makes the whole document invalid.
When a JSON parse fails, the error message often includes a character position but not a line number. This tool converts that position to a human-readable line and column number so you can jump straight to the problem. For valid JSON, it shows structural information: the root type (object, array, or primitive), the number of top-level keys or array items, the maximum nesting depth, and the byte size.
How to Use JSON Validator
Paste JSON into the input area or click "Load Sample"
The validator runs instantly — a green badge means valid, red means invalid
If invalid, the error message shows the exact line and column number
If valid, the stats bar shows type, key count, depth, and size
Common Use Cases
- Developers checking API response bodies for validity before processing.
- QA engineers verifying that JSON test fixtures are syntactically correct.
- Teams validating JSON configuration files before deployment.
- Developers debugging "Unexpected token" errors from JSON.parse in production.
- Data engineers verifying JSON exports before importing into databases.
- Students learning JSON by checking whether their hand-written JSON is correct.
Example Input and Output
A JSON object with a trailing comma — a common mistake — fails validation with a precise error location.
{
"host": "localhost",
"port": 8080,
"debug": true,
}✗ Invalid JSON
Unexpected token '}' at line 5, column 1
Fix: remove the trailing comma after "debug": truePrivacy
All validation runs in your browser. No data is uploaded to any server.
Quick fix
If validation fails, try the JSON Fixer tool — it automatically repairs the most common issues: trailing commas, single quotes, bare keys, and Python-style True/False/None literals.
See common JSON errors
Browse broken-and-fixed examples for the 15 most common JSON errors, each with the exact error message it throws and why it fails.
Frequently Asked Questions
What is the difference between JSON Validator and JSON Formatter?
JSON Validator only checks whether JSON is syntactically valid and reports errors. JSON Formatter takes valid JSON and pretty-prints it with indentation. If your JSON has errors, use the Validator to find them, then the Fixer to repair them, then the Formatter to clean up the output.
Why does the error say "position N" instead of a line number?
Different browsers and JavaScript engines report JSON parse errors differently. The validator extracts the character position from the error and converts it to a line and column number. In rare cases where the browser only reports a position, the tool calculates the line from the character offset.
What does "depth" mean in the stats?
Depth is the maximum nesting level of the JSON structure. A flat object has depth 1; an object with a nested object has depth 2; and so on. High depth can indicate over-complex data structures.
Is my JSON sent to a server?
No. All validation runs in your browser using JSON.parse. Your JSON never leaves your device.
Can this validate JSON Schema?
No — this tool validates JSON syntax (is it parseable?), not JSON Schema compliance (does it match a schema definition?). For schema validation, you need a JSON Schema validator library.
Related Tools
JSON Formatter
Format, validate, and beautify JSON instantly — with clear error messages, Tree View, Diff mode, and Schema validation.
JSON Fixer
Fix broken or invalid JSON automatically. Repairs trailing commas, single quotes, bare keys, Python literals, and JavaScript comments.
JSON Cleaner
Clean JSON by removing null values, empty strings, empty arrays, and empty objects. Configurable per value type with a removal count stat.
JSON Sorter
Sort JSON object keys alphabetically in ascending or descending order, with deep or shallow sorting and optional array sorting.
JSON Tree Viewer
Visualize JSON data in an interactive tree structure.
JSON Path Tester
Test JSONPath expressions against your JSON.

