Tools & Infrastructure

JSON Explained — The Language Machines Use to Talk to Each Other

JSON is how apps share information — like a universal note-pass between computers. Learn how it works and why it's everywhere.

Scroll to start

What Is JSON, Really?

JSON stands for JavaScript Object Notation. It's a way of writing down information so that any computer can read it — no matter what programming language it speaks. Think of it like a shipping label on a box. The label tells everyone exactly what's inside and how it's organized.

Here's a simple example of JSON that describes a person:

person.json
{
  "name": "Alex Rivera",
  "age": 28,
  "isStudent": false,
  "favoriteColor": "blue"
}

That looks a lot like plain English with some curly braces and quotes, right? That's the point. JSON is designed to be easy for humans to read AND easy for computers to understand. No special software needed — if you can read this, you can read JSON.

Why JSON Is Everywhere

Before JSON, computers had a much harder time talking to each other. Different programs used different formats, like private languages only certain groups understood. JSON changed that by becoming the universal translator of the internet.

Today, whenever you check the weather on your phone, stream a video, or use an app that logs in with Google, JSON is working behind the scenes. Your phone asks a server "Hey, what's the weather?" and the server replies in JSON. Your phone reads it, and boom — you see sunny with a high of 72°.

💡 Key Insight

JSON is the common language that lets your phone, a weather website, a smart thermostat, and a hundred other things all talk to the same server — without any of them having to agree on anything beforehand. It made the internet a lot less messy.

Reading and Writing JSON

JSON is built on a few simple rules. Once you know them, you can read any JSON file:

  • Text goes in quotes: "name" — these are called strings
  • Numbers don't: "age": 28 — just write the number plain
  • True or false: "isStudent": false — these are called booleans
  • Empty means nothing: "nickname": null — null means "no value set"
  • Lists use square brackets: "skills": ["typing", "drawing"]
  • Groups use curly braces: { "key": "value" }

You can also put objects inside objects — that's called nesting. Here's a more complex example:

complex.json
{
  "teacher": {
    "name": "Ms. Chen",
    "subject": "Biology",
    "yearsExperience": 12
  },
  "class": {
    "name": "5th Grade Science",
    "students": 24,
    "room": "204"
  }
}

An API Response in JSON

Here's what a real JSON response looks like — imagine you asked a music app for info about a song:

song-response.json
{
  "song": {
    "title": "Blue Skies",
    "artist": "The Morning Crew",
    "album": "Sunrise Sessions",
    "durationSeconds": 214,
    "year": 2023
  },
  "available": true,
  "formats": ["mp3", "flac", "aac"]
}

Your app reads this JSON and knows: the song is "Blue Skies" by The Morning Crew, it's 214 seconds long, it's available to play, and it comes in three audio formats. Everything in one neat package that any programming language can understand.

Knowledge Check

Test what you learned with this quick quiz.

Quick Quiz — 3 Questions

Question 1
What does JSON stand for?
Question 2
In JSON, what do you use to create a list of multiple values?
Question 3
What does the value null mean in JSON?
🏆

You crushed it!

Perfect score on this module.