JSON — The Language of Data

Learn JSON, the universal format that APIs use to send and receive structured data between browsers and servers.

Step 1 of 6

What Is JSON and Why Does It Exist?

When a server needs to send data to your browser, it can't just send a JavaScript object — that's a concept that only exists inside a running JavaScript program. The server and browser need a text format they both understand. That format is JSON (JavaScript Object Notation).

JSON was created to be human-readable and easy for machines to parse. Before JSON, the web used XML — a much more verbose format with opening and closing tags everywhere (like HTML). JSON won because it's dramatically simpler. Compare these two ways of representing a user:

XML: <user><name>Alice</name><age>25</age></user>
JSON: {"name": "Alice", "age": 25}

Today, JSON is the universal language of web APIs. When you fetch data from Instagram, Google Maps, Amazon, or any modern service, the server almost always responds with JSON. Learning to read and work with JSON is essential for data fetching.

Think of it this way: JSON is like a standardized shipping label. It doesn't matter whether the package is coming from New York or Tokyo — if everyone uses the same label format, any postal service can read it. JSON is that universal label format for data on the web.
Learn more on MDN
JAVASCRIPTREAD ONLY
CONSOLE
Click "Run" to execute your code...