JSON syntax in 30 seconds
Data lives in objects ({} with keyβvalue pairs) and arrays ([] with ordered lists):
{
"name": "Layla",
"city": "Berlin",
"languages": ["English", "Arabic"],
"memberSince": 2021,
"verified": true
}The rules are strict: double quotes around strings and keys, no trailing commas, no comments, and only six data types β string, number, boolean, null, object, array. Break a rule and parsers reject the whole document, which is why formatters and validators exist.
JSON vs XML
| JSON | XML | |
|---|---|---|
| Readability | Concise, close to how code looks | Verbose with opening/closing tags |
| Size | Smaller payloads | Larger for the same data |
| Data model | Maps directly to objects/arrays | Document-oriented, supports attributes |
| Extras | No comments, no schemas built in | Comments, namespaces, XSD validation |
| Typical use | Web APIs, configs | Documents, enterprise messaging, RSS |
JSON won the API wars on simplicity, but XML still rules where documents need comments, mixed content or formal schemas.
β JSON FAQs
What does JSON stand for?
JavaScript Object Notation. It's language-independent β nearly every programming language handles it natively.
What is JSON used for?
Moving data between servers and apps (APIs), configuration files, and storing structured data.
JSON vs XML β which is better?
JSON is lighter and simpler β ideal for APIs. XML is more verbose but supports attributes, comments and schemas.
Is JSON a programming language?
No. It's a strict data format β double quotes, no trailing commas, no comments. It describes data; it runs nothing.
Related: What Is Base64? Β· What Is a Meta Tag? Β· Free JSON Formatter