Validate JSON Online
Paste your JSON below. The validator checks syntax instantly, highlights the exact error line, and explains what went wrong — all in your browser with no data leaving your device.
What Gets Validated
The validator checks every rule in the JSON specification (RFC 8259):
| Rule | What We Check | Common Mistake |
|---|---|---|
| String quoting | All strings must use double quotes | Using single quotes |
| Key quoting | All object keys must be quoted strings | Bare keys like {name: ...} |
| No trailing commas | Comma must separate two values | Comma after last item |
| No comments | JSON has no comment syntax | // or /* */ inside JSON |
| Valid values only | Only string/number/object/array/true/false/null | undefined, NaN, Infinity |
| Balanced brackets | Every { and [ must be closed | Missing } or ] |
| Escaped characters | Special chars in strings must be escaped | Unescaped newlines in strings |
Validate JSON in Your Code
For runtime validation in JavaScript and Python:
// JavaScript — simple validator
function isValidJSON(str) {
try {
JSON.parse(str);
return true;
} catch {
return false;
}
}
// Python
import json
def is_valid_json(s):
try:
json.loads(s)
return True
except json.JSONDecodeError:
return FalseValidation vs. Schema Validation
This tool validates JSON syntax. If you need to validate that your JSON matches a specific structure (required fields, type constraints, enum values), use the JSON Schema Validator which supports JSON Schema Draft-07.
Frequently Asked Questions
What does a JSON validator check?▾
A JSON validator checks that your text conforms to the JSON grammar defined in RFC 8259. It verifies: all strings use double quotes, all object keys are quoted strings, no trailing commas exist, values are only strings/numbers/objects/arrays/true/false/null, and the overall structure is balanced (all braces and brackets are closed).
What is the difference between JSON validation and JSON schema validation?▾
JSON validation checks syntax — whether the text is parseable JSON at all. JSON Schema validation goes further and checks structure: whether an object has required fields, whether values match expected types, and whether numbers are within ranges. Use the JSON Schema Validator tool on this site for schema-level validation.
Is my JSON data sent to a server when I validate it?▾
No. The validator on this page runs entirely in your browser using the browser's built-in JSON.parse() function. Your JSON data never leaves your device.
How do I validate JSON in JavaScript code?▾
Wrap JSON.parse() in a try/catch: try { JSON.parse(str); return true; } catch { return false; }. This is the simplest and most reliable approach since the JS engine parses it with the same rules as any other JSON parser.
What are the most common JSON validation errors?▾
The five most common are: (1) trailing commas after the last array element or object property, (2) single-quoted strings instead of double-quoted, (3) unquoted object keys, (4) JavaScript comments inside JSON, and (5) undefined, NaN, or Infinity values.
More JSON Tools
If jsondecode.com saved you time, share it with your team
Free forever. No ads. No sign-up. Help other developers find it.