Free tool · runs in your browser
JSON validator
Check whether JSON is valid, and find the exact line, column and reason when it is not.
Follows the JSON standard (RFC 8259) strictly and checks everything in your browser.
Quick answer
Paste your JSON to check it against the RFC 8259 standard. If it is invalid, you see the line and column and a plain explanation, such as a trailing comma or single quotes. If it is valid, you see its size, nesting depth and counts of keys and values, plus a warning for any duplicate keys, which are legal but risky. Nothing is uploaded.
How to use it
- Paste your JSON. Results update as you type.
- Read the verdict. Valid, or the line, column and reason for the first error.
- Fix and repeat. Fix that error and check again, as one error can hide others.
Example
A trailing comma, which JavaScript allows but JSON does not:
Input
{
"name": "Sara",
"age": 30,
}Output
Line 4, column 1
Trailing comma: remove the comma before this closing brace.Common errors and how to fix them
Trailing comma- Remove the comma after the last item in an object or array.
Strings must use double quotes- Replace 'single' with "double" quotes, on both keys and values.
Keys must be in double quotes- Write {"name": 1}, not {name: 1}.
Unexpected text after the end of the JSON- Only one top-level value is allowed. Wrap several objects in an array, or check for NDJSON (one object per line).
Frequently asked questions
What are the most common JSON errors?
Trailing commas, single quotes instead of double quotes, keys without quotes, missing commas between items, and comments. All are valid in JavaScript objects, but not in JSON.
Are trailing commas allowed in JSON?
No. RFC 8259 does not allow them, even though JavaScript does. Remove the comma before } or ].
Can JSON have comments?
No. Standard JSON has no comments. Formats such as JSONC and JSON5 allow them, but ordinary JSON parsers reject them.
Are duplicate keys valid?
They are allowed by the grammar, but the standard warns against them, as results vary. Most parsers keep only the last value, which can silently lose data.
How is this different from the JSON formatter?
This tool focuses on finding problems, with explanations and statistics. The JSON formatter makes valid JSON readable or compact.
Why does True or None fail?
Those are Python spellings. JSON uses lowercase true, false and null.
Does it validate against a JSON Schema?
No. It checks that the syntax is valid JSON, not whether the data has the fields you expect.
Is my data sent anywhere?
No. It is checked in your browser, so it is safe for API responses and configuration files.
How do I make valid JSON readable?
Use the JSON formatter, which adds indentation or makes it compact.
Can JSON be just a number or a string?
Yes. RFC 8259 allows any JSON value at the top level, not only objects and arrays.
Sources
Related
More tools in this group
- HTML formatter
- CSS minifier
- JavaScript minifier
- HTML encoder
- URL encoder and decoder
- Base64 encoder and decoder
- Unix timestamp converter
- UUID generator
- SHA-256 hash generator
- Regex tester
- Color converter
Guides and apps
- Scaling a Node.js API from 200K to 1M users with 60% faster responses
- Why users get logged out at random, and how to fix JWT session bugs
- How we kept a backend fast at 300M+ users: indexes, Redis and RPC failover
- Hire a Node.js backend developer
- Hire an AI full stack developer
- Hire me to build AI and backend systems