JSON in 10 Minutes: A Practical Start
If you've ever opened a config file, worked with an API, or edited a package.json, you've already used JSON — maybe without realizing it. It's everywhere in modern software, and the good news is, it's genuinely simple. Let me show you the essentials.
What Exactly is JSON?
JSON stands for JavaScript Object Notation, but don't let the name fool you — it works with every programming language out there. Think of it as a universal way to describe structured data that both humans and computers can understand. When a mobile app fetches data from a server, that data almost certainly comes back as JSON.
The Six Building Blocks
JSON is built from just six types: strings (wrapped in double quotes), numbers (integers like `42` or decimals like `3.14`), booleans (`true` or `false`), `null` (representing nothing), arrays (ordered lists), and objects (key-value pairs). That's it. No classes, no inheritance, no complexity.
Objects: The Heart of JSON
An object is a collection of key-value pairs inside curly braces. Think of it like a dictionary or a lookup table. Keys are always strings, and values can be anything — another string, a number, an array, or even another object.
Arrays: Ordered Lists
Arrays are lists of values in square brackets. Unlike objects, order matters here — the first item is at index 0, the second at index 1, and so on. You can mix different types in the same array.
Nesting: Where It Gets Powerful
Here's where JSON really shines. Objects can contain arrays, and arrays can contain objects. You can nest them as deep as you need. This is how real-world data looks — a user with a list of orders, each order containing a list of items, each item with its own properties.
Rules to Live By
A few things that will save you hours of debugging: always double quotes (single quotes break JSON), never a trailing comma after the last item, use descriptive key names (not `d1`, `d2`), and validate before you ship. The last one is especially important — a single misplaced comma can bring down an entire API.
Your Next Step
Theory is nice, but hands-on is better. Grab a real API response (try fetching any public API), paste it into our formatter, and play with the structure. Collapse and expand nested objects, read the syntax highlighting, and watch how the data is organized. That's the fastest way to build intuition.