What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data format for structured information. It uses objects `{}` and arrays `[]` with key-value pairs, strings in double quotes, and literals for numbers, booleans, and null. JSON is language-independent and the de facto standard for REST APIs, configuration files, and message queues.
Why developers use JSON
JSON is human-readable when pretty-printed, easy to parse in every major language, and maps naturally to native data structures. Unlike XML, it has minimal syntax overhead, which reduces payload size and parsing complexity.
JSON data types
JSON supports strings, numbers, booleans, null, objects, and arrays. It does not support comments, trailing commas, single-quoted strings, or undefined values — common sources of validation errors.
Example
{"name": "Weblexia", "active": true, "count": 3}Common mistakes
Trailing commas
Remove commas after the last property in objects or arrays.
Single quotes
Use double quotes for strings: `"key"` not `'key'`.