What is JSON?
JSON is a lightweight text format for storing and transporting data. It is human-readable, language-independent, and the standard format for REST APIs. Almost every modern web service uses JSON to send and receive data.
Why Format JSON?
Minified JSON (all on one line) is efficient for transport but impossible to read. Formatted JSON (with indentation) is easy to understand at a glance:
- Minified:
{"name":"John","age":30,"city":"NYC"} - Formatted:
{"name": "John",
"age": 30,
"city": "NYC"}
Common JSON Errors and How to Fix Them
- Missing comma:
{"a": 1 "b": 2}→ Add,after1 - Single quotes:
{'key': 'value'}→ Must use double quotes - Trailing comma:
{"a": 1,}→ Remove the last comma - Unquoted keys:
{key: "value"}→ Keys must be in double quotes
How to Format and Validate JSON Online
FAQ
What's the difference between JSON and JSON5?
JSON5 is a superset of JSON that allows comments, trailing commas, and unquoted keys — making it more human-friendly. However, standard JSON parsers don't support JSON5 syntax.