JSON (JavaScript Object Notation) is a lightweight, text-based data format used to store and exchange structured data. It is the universal language of web APIs — when your app talks to a server, the response almost always comes back as JSON.
JSON has a simple, strict syntax with only a handful of rules:
"key": "value"{}, arrays in []{
"name": "Alice Johnson",
"age": 30,
"isActive": true,
"score": 98.5,
"address": null,
"tags": ["developer", "designer"],
"contact": {
"email": "alice@example.com",
"phone": "+1-555-0100"
}
}[
{ "id": 1, "product": "Laptop", "price": 999.99 },
{ "id": 2, "product": "Mouse", "price": 29.99 },
{ "id": 3, "product": "Keyboard","price": 79.99 }
]{
"order": {
"id": "ORD-2026-001",
"customer": {
"name": "Bob Smith",
"tier": "premium"
},
"items": [
{ "sku": "LAP-001", "qty": 1, "price": 999.99 },
{ "sku": "MSE-042", "qty": 2, "price": 29.99 }
],
"total": 1059.97,
"shipped": false
}
}{ 'name': 'Alice' }{ "name": "Alice" }{ name: "Alice" }{ "name": "Alice" }{ "tags": ["a", "b", ] }{ "tags": ["a", "b"] }{ "active": True }{ "active": true }// comment
{ "x": 1 }{ "x": 1 }{ "val": undefined }{ "val": null }JSON stands for JavaScript Object Notation. Despite the name, it is language-independent and used across Python, Go, Java, Ruby, and virtually every modern programming language.
JSON is primarily used for transmitting data between a server and a web application (REST APIs), storing configuration files, and as a data interchange format between services.
JSON supports 6 data types: string, number, boolean (true/false), null, object (key-value pairs in {}), and array (ordered list in []).
No. JSON is a data format inspired by JavaScript object syntax, but it is strictly a text format. Unlike JavaScript objects, JSON keys must be double-quoted strings, and it does not support functions, comments, or undefined values.