How to Validate JSON
JSON validation is the process of checking whether a JSON string conforms to the JSON specification (RFC 8259). This guide explains what makes JSON valid, walks through the most common errors, and shows you how to fix them instantly using an online JSON validator.
What Makes JSON Valid?
JSON (JavaScript Object Notation) is defined by RFC 8259. A valid JSON document must follow six rules:
How to Validate JSON Online — 3 Steps
Common JSON Errors Explained
Here are the four errors that account for the vast majority of invalid JSON:
This is the most common error. Developers coming from JavaScript or Python often use single quotes for strings. JSON strictly requires double quotes.
{'name': 'Alice', 'age': 30}{"name": "Alice", "age": 30}JavaScript allows trailing commas in arrays and objects. JSON does not. The last element must not be followed by a comma.
{
"name": "Alice",
"age": 30,
}{
"name": "Alice",
"age": 30
}In JavaScript, object keys don't need quotes. In JSON, all keys must be strings wrapped in double quotes.
{name: "Alice", 1: "one"}{"name": "Alice", "1": "one"}JSON5 and JavaScript allow comments. Standard JSON (RFC 8259) does not. Remove any // or /* */ comments from your JSON before validating or parsing.
{
// user info
"name": "Alice"
}{
"name": "Alice"
}JSON vs JSON5 vs JSONC
Standard JSON (RFC 8259) — the universal format used by all APIs, databases, and language parsers. Strict: no comments, no trailing commas, double quotes only.
JSON5 — a superset of JSON that allows comments, trailing commas, and single quotes. Used in some config files. Not supported by standard parsers.
JSONC — JSON with Comments. Used by VS Code config files (settings.json, tsconfig.json). Also not parseable by standard JSON.parse().
This validator checks against standard RFC 8259 JSON — the format used by all APIs and language parsers.
Ready to Validate Your JSON?
Free, instant, and 100% private — your JSON never leaves your browser.
Open JSON Validator