JSON Validator
Paste JSON to check for syntax errors. Shows exact line and column of any issue.
2sp · UTF-8
What is a JSON Validator?
A JSON validator checks your JSON text against the official JSON specification (RFC 8259) and tells you whether it is valid or not. If it finds a problem it tells you exactly which line and column the error is on, so you can fix it without guessing.
Common JSON Errors
✕ Missing comma between properties
Invalid
{ "name": "Ravi" "age": 28 }Valid
{ "name": "Ravi", "age": 28 }✕ Trailing comma after last property — valid in JS, not in JSON
Invalid
{ "name": "Ravi", }Valid
{ "name": "Ravi" }✕ Single quotes — JSON requires double quotes
Invalid
{ 'name': 'Ravi' }Valid
{ "name": "Ravi" }✕ Unquoted key — all keys must be quoted strings
Invalid
{ name: "Ravi" }Valid
{ "name": "Ravi" }✕ undefined is not valid JSON — use null
Invalid
{ "value": undefined }Valid
{ "value": null }Validate JSON in Code
JavaScript:
js
try {
const data = JSON.parse(jsonString);
console.log("Valid:", data);
} catch (e) {
console.error("Invalid JSON:", e.message);
}Python:
python
import json
try:
data = json.loads(json_string)
print("Valid:", data)
except json.JSONDecodeError as e:
print(f"Invalid: {e.msg} at line {e.lineno}, col {e.colno}")Node.js (from file):
js
const fs = require("fs");
try {
const data = JSON.parse(fs.readFileSync("data.json", "utf8"));
console.log("Valid");
} catch (e) {
console.error("Invalid:", e.message);
}Features
Live validation
Validates as you type — no button press needed
Exact location
Shows the exact line and column of every error
Clear messages
Error messages explain what went wrong in plain English
File size stats
Shows byte count and line count when JSON is valid