What is JavaScript Object Notation (JSON)
JSON (short for JavaScript Object Notation) is a simple way to store and share information. It’s often used when websites or apps need to send data back and forth, like when you’re filling out a form online or loading your profile in an app.
Even though the name includes “JavaScript,” JSON is not a programming language. It’s just a format: a way to organize data so computers can read it easily. Think of it like a digital version of a neatly labeled form. It tells computers: “Here’s a name, here’s an age, here’s a list of items.”
Examples
| Code snippet | What it does |
| { “name”: “Taylor”, “age”: 25, “member”: true } |
This is a person named Taylor, who is 25 years old and a member. |
| { “fruits”: [“apple”, “banana”, “cherry”] } |
A list of fruits. |
| { “product”: { “id”: 123, “name”: “Lamp”, “price”: 29.99 } } |
Details about a product (a lamp). |
A brief history
JSON was created in the early 2000s by a developer named Douglas Crockford. It was meant to be a simpler alternative to XML (another data format), and it quickly became popular because of how easy it is to read and use.
JSON has become the go-to choice for modern web development because it’s easy to use and works with almost every programming language. You’ll find it everywhere, from websites to mobile apps to APIs. But XML hasn’t completely disappeared, especially in legacy systems and industries with very structured data requirements.
Good to know
Although JSON was inspired by JavaScript, you don’t need to know JavaScript to use it.
The JSON format is built around something called key-value pairs. This just means every piece of information has a label (the key) and a value. For example, “name”: “Taylor” means the label is “name” and the value is “Taylor.” All of these key-value pairs are wrapped in curly braces { } to form a complete JSON object.
Know more