JSON looks like text, but the moment a parser reads it, it stops being text and becomes values: numbers you can do arithmetic on, booleans that are simply true or false, lists with a definite order, and objects that map names to things. That distinction — values, not text — is the single most useful idea a beginner can internalize, and it is nearly impossible to learn from definitions alone. You learn it by watching a parser turn text into structure, over and over, on data you actually care about.
Most people try to learn JSON the way they learn vocabulary: read a tutorial, memorize the rules, move on. That works until the first real API response lands in their lap and every rule blurs together. A better path runs the other direction: take JSON you find in the wild — a response from a public API, a config file in a project, a payload copied from a network tab — and take it apart with the JSON Inspector. This guide walks through a workflow you can repeat with any document. It takes about five minutes per document, and if you run it a dozen times, most of JSON's rules stop being memorized and start being obvious.
Grab JSON from somewhere real
Anything textual and brace-heavy will do: a weather or transit API response, a package.json, an export from a notes app, a settings file. Real data beats tutorial data on purpose — it is messier, it mixes types, and it occasionally surprises you, which is exactly when learning happens. Copy the whole document and paste it into the inspector.
For this walkthrough, use a small but realistic example — the kind of response a weather API might return:
{
"city": "Portsmouth",
"observed": {
"temp_c": 14.5,
"humidity": 72,
"raining": false
},
"hourly": [14.5, 15.1, 15.8, 15.2],
"sources": ["station-42", "station-07"]
}
Nothing here is exotic, and that is the point. By the end of this guide you should be able to say — without guessing — what type every value is and why the document is shaped the way it is.
Read the Tree tab first
Once the document parses, start with the Tree tab, not the raw text. The tree is the parser's understanding of your document, laid out as structure: what contains what, and of what type. Objects appear as braces with named members — each key pointing at one value. Arrays appear as ordered lists, usually with an index count telling you how many elements they hold. Reading the tree of the weather response gives you something like this:
document
├─ city → "Portsmouth" (string)
├─ observed → { 3 members } (object)
│ ├─ temp_c → 14.5 (number)
│ ├─ humidity → 72 (number)
│ └─ raining → false (boolean)
├─ hourly → [ 4 items ] (array of numbers)
└─ sources → [ 2 items ] (array of strings)
Two habits to build here. First, name the type of every value as you read it: that number is a number, not a string that happens to contain digits; false is a boolean, not the text "false". Second, notice what the two container shapes mean. Every { } is a lookup table from names to values, and every [ ] is a sequence with a length and an order. If you keep those two straight, you already know most of JSON's grammar.
| Term | What it means |
|---|---|
| Value | Any single piece of data: a string, number, boolean, null, object, or array |
| Object | Curly braces holding named members — a mapping from keys to values |
| Array | Square brackets holding an ordered list of values, addressable by index |
| Member (key) | The name part of an object entry; always a string, unique within its object |
| Nesting | Values inside values; each level down is one more layer of braces or brackets |
| Parser | The program that reads the text and turns it into values — what your inspector runs |
Then read the Code tab
Switch to the Code tab and look at the same document as text. The thing to study is not the individual characters but the indentation: each new level of indentation is one level of nesting. Depth one in the weather response holds city, observed, hourly, and sources; depth two holds what lives inside observed.
{
"city": "Portsmouth", ← depth 1
"observed": { ← depth 1, opens an object
"temp_c": 14.5, ← depth 2
"humidity": 72,
"raining": false
},
"hourly": [14.5, 15.1, 15.8], ← depth 1, opens an array
"sources": ["station-42"]
}
Indentation is formatting, not grammar — a JSON document on a single line is just as valid — but documents written with consistent indentation are easy to eyeball, and readers who understand depth can often spot an unclosed brace before the parser complains. Switching between the two tabs is also your fastest diagnostic move: if the tree is empty, the problem is syntactic; if the tree exists but a branch looks wrong, the problem is structural.
Use the example chips deliberately
The inspector ships with example chips — one-click documents you can load without hunting for data. Treat them as tiny lessons rather than toys. Each one exists to demonstrate a specific rule of the language, and each pays off best if you read it, predict what the parser will do, and only then load it.
The duplicate-key example: keys are unique per object
This chip contains the same key twice inside one object:
{
"mode": "auto",
"mode": "manual"
}
It parses without an error, which surprises most beginners — and then the surprise deepens, because different parsers disagree about which value wins. The rule to take away: within a single object, a key should appear at most once. Two objects in different parts of a document may freely reuse the same key, but duplicates inside one object are undefined territory, and production JSON should never depend on them.
The precision example: numbers are kept exactly as written
The precision chip shows two numbers that behave very differently from how they look:
{
"list_price": 19.99,
"id": 100000000000000000001
}
JSON itself says nothing about how numbers are stored — it only defines how they are written. The price is written as a decimal but stored by many runtimes as a floating-point value, which cannot represent 19.99 exactly. The enormous id, meanwhile, gets rounded when a JavaScript-style parser converts it to its number type. The lesson: a number in JSON is a value written in a particular notation, and the notation can carry meaning. If a value must not change even by one digit — an identifier, a price — treat it as special, and check what your tools do with it.
The broken-JSON example: error messages have coordinates
The third chip is deliberately invalid. Paste it and read the error message carefully, including its line and column numbers:
{
"name": "Ada",
"tags": ["math", "navy"],
"active": true,
}
The parser points at the very last line — and the culprit is the comma hanging after true. Notice the general pattern: parsers report the position of the character that confused them, not necessarily the character that caused the mistake. The line-and-column coordinates still save you from scanning the whole document; jump there, then look just before the reported spot. Our guide on JSON syntax errors and line/column numbers covers this in depth.
A guided mini-exercise: predict, then paste
Here is the habit that turns inspection into learning: predict before you paste. Run it as a loop, every time you meet a new document.
Step 1. Find a JSON document in the wild and read it as plain text for thirty seconds. Step 2. Write down (or say out loud) three predictions: Is the top level an object or an array? How many members or items does it hold? Pick two values and name their types. Step 3. Paste the document into the JSON Inspector and compare. Tree tab for structure, Code tab for depth. Step 4. Wherever a prediction was wrong, stop and figure out why — that gap is the lesson, and it is worth more than any tutorial paragraph.
Run this loop three times on real data and you will notice your predictions converging. That convergence is what "knowing JSON" actually feels like: you are no longer guessing, because you have internalized how parsers see documents.
Four traps every beginner hits
As you inspect more documents, the same handful of mistakes shows up again and again. Meeting each one deliberately — in a tool that tells you exactly what went wrong — is far cheaper than meeting it in production.
Single quotes
{ 'name': 'Ada' } is the most natural first guess and it always fails. Strings in JSON — both keys and values — require double quotes; this is not a style preference but part of the grammar. See why JSON requires double quotes for the full reasoning.
Trailing commas
Many languages tolerate a comma after the final element of a list. JSON does not: a comma must always be followed by another member or item, so the comma before a closing brace or bracket is always an error. The broken-JSON chip above fails for exactly this reason.
Comments
JSON has no comment syntax. // and /* */ are invalid anywhere in a document. Files that look like "JSON with comments" are usually a different dialect such as JSON5 or JSONC; a strict parser will reject them.
Confusing [ ] and { }
An empty array and an empty object both parse cleanly and both look "empty", yet they mean different things — an ordered list with zero items versus a lookup table with zero entries — and mixing them up produces code that reads the wrong kind of container. The guide on empty arrays vs. empty objects unpacks the difference.
None of these traps are difficult once you have seen each one fail in front of you. That is what the workflow exists for: meet the rules on purpose, in a tool that points at the exact character, before the rules meet you on a deadline. Inspect first, guess never — that is the whole method.
Reproduce every example locally with the JSON Inspector or the matching tool on the workbench. Nothing you paste leaves your browser.