JSON Validator — Check JSON Syntax Online Free
Paste your JSON to instantly check if it's valid and locate any syntax errors with exact line and column numbers.
What is JSON Validation?
JSON validation checks whether a JSON string conforms to the JSON specification (RFC 8259). Unlike JavaScript object literals, JSON has strict rules: all keys must be double-quoted strings, trailing commas are not allowed, and values must be one of six types: string, number, object, array, boolean, or null. This free online JSON validator highlights the exact line and column of any syntax error, making it fast to find and fix malformed JSON. Everything runs in your browser — no data is sent to any server.
Common JSON Syntax Errors
- Single quotes instead of double quotes — JSON requires
"key", not'key' - Trailing commas —
[1, 2, 3,]is invalid; the last element must have no comma - Unquoted keys —
{name: "John"}is invalid; keys must be quoted - Comments —
// commentsand/* block comments */are not part of the JSON spec - Undefined or NaN values — only
nullis valid;undefinedandNaNare JavaScript-only - Mismatched brackets — every
{needs a closing}and every[needs a closing]
How to Validate JSON in Python
Use json.loads() inside a try/except block:
import json
try:
json.loads(your_json_string)
print("Valid JSON")
except json.JSONDecodeError as e:
print(f"Invalid JSON: {e}")
How to Validate JSON in JavaScript
Use JSON.parse() inside a try/catch block:
try {
JSON.parse(jsonString);
console.log("Valid JSON");
} catch (e) {
console.error("Invalid JSON:", e.message);
}
Once your JSON is valid, use the JSON Formatter to beautify it, the JSON Minifier to compress it, or the JSON Diff tool to compare two JSON objects.
Frequently Asked Questions
What makes JSON invalid?
Common causes: missing quotes around keys, trailing commas, single quotes instead of double quotes, unescaped special characters, or mismatched brackets and braces.
Is my data safe?
Yes. All validation runs entirely in your browser. No data is ever sent to a server.
What JSON spec does this follow?
This validator follows RFC 8259, the current JSON standard. Comments and trailing commas are not valid JSON per this spec.
How do I check if JSON is valid online?
Paste your JSON into the input panel on the left — validation runs automatically. If your JSON is invalid, the exact error line and column number are highlighted in the gutter and shown in the result panel.
How do I validate JSON in Python?
Use json.loads() inside a try/except block. If it raises a json.JSONDecodeError, the JSON is invalid. For quick browser-based validation without writing code, use this tool.
What is JSON lint?
JSON lint is just another term for JSON validation — checking your JSON for syntax errors. "Lint" refers to the general practice of static-checking code or data for errors. JSON lint and JSON validator mean the same thing.
Can JSON have comments?
No. Comments are not part of the JSON specification (RFC 8259). If you need comments in JSON-like config files, consider JSON5 or YAML, both of which support comments. Standard JSON parsers will reject any input containing comments.
How do I validate JSON in JavaScript?
Wrap JSON.parse(jsonString) in a try/catch block. If it throws, the JSON is invalid. The error message will include the position of the syntax error.