JSON Explained
What JSON is, why every app uses it, and how to read it — explained simply.
The Machine Translation Format
Imagine two people who speak different languages trying to pass notes in class. They need a language they both understand — something simple both can read and write quickly. JSON is that shared language for computers. It stands for JavaScript Object Notation, but you don't need to know JavaScript to understand it.
JSON is just a way to organize information so two computers can understand each other. It's plain readable text with a few simple rules. Every programming language can read JSON, which is why it's the go-to format when apps talk to each other over the internet.
Think of it like a labeled moving box. Instead of just throwing stuff in, you write a label on each section so whoever opens it knows exactly what's inside and where it goes.
The Universal Translator of the Internet
Every time you use an app, it talks to a server — a computer somewhere that holds the app's data. That server needs to send your phone or browser information about your account, your messages, your orders. JSON is the most common way that information gets packaged and sent.
When you check the weather in an app, the weather service sends JSON to your phone. When you log into a website with Google, Google sends JSON to that website. When AI gives you an answer, your vibe coding tool often sends your request and receives its response as JSON.
If you've ever heard someone say "the API returned an error" — that error almost certainly came back as JSON. Understanding it even a little helps you debug problems instead of feeling lost when something breaks.
💡 Key Insight
JSON is so universal that almost every AI tool, weather service, payment processor, and social media platform uses it. If you understand JSON, you understand how half the internet moves data around.
The Simple Rules of JSON
JSON has just a handful of data types. Once you know these, you can read almost any JSON file.
- Text/string — words in quotes:
"Hello" - Number — integers or decimals, no quotes:
42or3.14 - True/false — the words
trueorfalse, lowercase, no quotes - Null — means "nothing here":
null - List/array — a collection in square brackets:
["apple", "banana", "cherry"] - Object — a group of labeled items in curly braces:
{"name": "Alex", "age": 28}
The most important one is the object — it's a set of key-value pairs. The key is always a string in quotes. The value can be anything: a number, another object, a list. Objects can contain other objects, which lets you build deeply structured data.
{
// The whole thing is one object (curly braces)
"name": "Sarah Chen", // key "name" has a text value
"age": 31, // key "age" has a number value
"subscribed": true, // key "subscribed" is true/false
"tags": ["pro", "admin"], // key "tags" is a list
"address": { // key "address" is an object inside the object
"city": "Toronto",
"zip": "M5V 2T6"
}
}
A Real JSON Response
Here's what a real AI API might send back when you ask it a question. This is what your vibe coding tool works with behind the scenes:
{
"id": "chat-abc123",
"model": "claude-3-haiku",
"created_at": "2026-04-09T12:00:00Z",
"role": "assistant",
"content": "Here's a quick recipe for banana bread...",
"usage": {
"input_tokens": 28,
"output_tokens": 142
}
}
Your app receives this text, reads each field, and decides what to do with it. It might take the content field and display it on screen. It might check the usage numbers to count tokens spent. Every field has a label so the code knows exactly what it's looking at.
Knowledge Check
Test what you learned with this quick quiz.