JSON — the universal data format
How computers share structured information
⏱ Est. ~4 min
01 · Read
When a server sends data back to your app, it needs a format both sides understand. The most popular one on the web is JSON (JavaScript Object Notation).
JSON is a way to write structured data as plain text. It looks a lot like a simple list or form — names (called keys) paired with values, and it can hold lists and nested groups of data too.
Despite "JavaScript" being in the name, JSON is used in every programming language. It's the universal data format of the web.
💡 Picture thisJSON is like a neatly organized form. The form has labeled fields ("Name: ___", "Email: ___") and you fill in the values. JSON works the same way: every piece of data has a label (key) and a value. And just like a form can have sections ("Address: Street ___, City ___, Zip ___"), JSON can be nested too.
Key points
- JSON = JavaScript Object Notation — a plain-text data format
- Data is organized into key-value pairs: "name": "Sara"
- Curly braces {} mark an object (a group of key-value pairs)
- Square brackets [] mark an array (an ordered list)
- Objects can contain other objects — that's called nesting
02 · Code example
Here's what JSON actually looks like. This is the kind of data a server might send back when you view someone's profile page.
A JSON Object
{
"name": "Sara Johnson",
"age": 28,
"email": "sara@example.com",
"hobbies": ["reading", "hiking", "photography"],
"address": {
"street": "123 Oak Street",
"city": "Portland",
"state": "OR",
"zip": "97201"
}
}
Look at the structure: name is a text value, age is a number, hobbies is an array (a list in square brackets), and address is a nested object (another set of key-value pairs in curly braces). Everything is clearly labeled, so any program can easily read it.
03 · Match
Match each JSON concept to its description.
(This section is interactive — please enable JavaScript.)
04 · Quiz
In JSON, what does a pair of square brackets [ ] represent?
- An object
- A key-value pair
- A comment
- An array (an ordered list)
05 · Fill in the blank
JSON stands for JavaScript Object _____.
Other lessons in this chapter
⚠ The full interactive experience needs JavaScript. Please enable it and reload.
※ This is an independent Traditional Chinese teaching project — not an official Anthropic product. Claude™ is a trademark of Anthropic, PBC.