Definition
Every time you use a website, mobile app, or interact with pretty much any modern software, there is a very good chance JSON is involved behind the scenes. RFC 7159 was the specification that formally defined this ubiquitous data format back in 2014, establishing the rules that everyone follows when exchanging structured data on the web.
JSON stands for JavaScript Object Notation, but do not let the name fool you - it is used by every programming language imaginable, not just JavaScript. The reason JSON became so popular is that it is incredibly simple. It is just text that represents structured data using a handful of basic concepts: objects (curly braces), arrays (square brackets), strings, numbers, booleans, and null. That is it. A five-year-old could understand the basic structure, yet it is powerful enough to represent virtually any data.
Now, here is an important note: RFC 7159 has been superseded by RFC 8259 in 2017. The newer spec did not change the JSON syntax - it is the same curly braces and square brackets you know and love. The update mainly clarified that JSON text MUST be encoded in UTF-8 and added better guidelines for interoperability between different systems. If you are implementing JSON today, you should follow RFC 8259, but knowing about RFC 7159 helps you understand the evolution.
Example
Your social media feed: When you scroll through Twitter or Facebook, the app is receiving JSON data from the server. Each post comes as a JSON object containing the text, author, timestamp, likes count, and comments - all structured in a way the app can easily parse and display.
Weather apps: When a weather app shows you the forecast, it is probably getting JSON from a weather API. Something like {"city": "London", "temperature": 18, "conditions": "cloudy", "forecast": [...]}. Simple, readable, efficient.
Online shopping: Add an item to your cart on Amazon, and your browser sends JSON to the server: {"productId": "B07XJ8C8F5", "quantity": 2}. The server responds with updated cart information in JSON format.
Smart home devices: When you ask Alexa to turn on your lights, the communication between Amazon’s servers and your smart bulb manufacturer’s API often uses JSON: {"device": "living-room-light", "action": "on", "brightness": 75}.
Analogy
The Universal Shipping Container: Before standardized shipping containers, loading a ship was chaotic - every box was a different size. JSON is like the shipping container of data: a standardized format that every system can work with. It does not matter if the sender is a Python server and the receiver is a JavaScript app - the JSON container just works.
The Nested Filing System: Think of JSON like a filing cabinet where each drawer (object) contains folders (nested objects), and each folder contains documents (values). You can have folders within folders, creating organized hierarchies of information. The beauty is that anyone who opens the cabinet immediately understands the organization.
The Recipe Card Format: Imagine a universal recipe card format that all cookbooks in the world use. Ingredients are always listed the same way, instructions are always formatted identically. That is JSON for data - a universal format that everyone agrees on.
The LEGO Instruction Manual: LEGO instructions are universally understandable because they follow a consistent format. JSON is the LEGO of data formats - simple building blocks that can create complex structures, following rules everyone understands.
Code Example
// JSON data types defined in RFC 7159 (still valid)
{
"string": "Hello",
"number": 42,
"float": 3.14,
"boolean": true,
"null": null,
"array": [1, 2, 3],
"object": {
"nested": "value"
}
}
// No trailing commas (still invalid)
{
"valid": true,
"invalid": false, // β This comma is NOT allowed
}
// Numbers cannot have leading zeros
{
"invalid": 007, // β Wrong
"valid": 7 // β Correct
}
// Use RFC 8259 for current implementations