What is JSON? Validate it and fix common errors
Learn the data structures and validation habits that make JSON easier to exchange and maintain.
What JSON is
JSON (JavaScript Object Notation) is a text format used for configuration files, API requests, and data exchange. It is readable, but strict: one missing comma or extra quote can make parsing fail.
Core structure
JSON uses objects, arrays, and primitive values. Objects use braces and keys must be double-quoted; arrays use brackets. Valid values are strings, numbers, booleans, null, objects, and arrays.
{ "user": { "name": "Lin", "active": true }, "tags": ["api", "docs"] }Common validation failures
- Single quotes or unquoted keys.
- A trailing comma after the final item.
- An unescaped line break or quote inside a string.
- JavaScript-only values such as
undefined, comments, or functions.
A useful debugging order
Use a formatter or validator to find the error line, then check matching braces and brackets from the outside in. Once syntax is valid, validate field names, types, and business rules separately.
Takeaway
Syntax validation is the first gate for data quality. Valid JSON does not guarantee useful data, but invalid JSON prevents every later check.