Common Invalid JSON in JSON

From the JSON cheat sheet · Validation and Security · verified Aug 2026

Common Invalid JSON

Recognize syntax accepted by JavaScript but not JSON.

json
Invalid:
{'name':'Ana'}
{"active":True}
{"items":[1,2,]}
📌 JSON is stricter than JavaScript object syntax
⚠️ Comments are not part of RFC 8259
💡 Use a parser instead of visual inspection
🎯 Return useful validation errors without leaking data
validationinvalid-jsonpitfalls

Continue with JSON

Save the full cheat sheet or work through every related task.

More JSON tasks

Back to the full JSON cheat sheet