JSON shows up everywhere in modern software โ API responses, configuration files, browser storage, app settings โ and while it looks intimidating as a dense wall of curly braces and brackets on first encounter, the entire format rests on just a handful of simple rules. Once those rules click, reading even a large, unfamiliar JSON structure becomes a matter of pattern recognition rather than confusion. This guide explains the format from first principles.
What JSON actually stands for and why it exists
JSON (JavaScript Object Notation) is a lightweight, text-based format for representing structured data, originally derived from how JavaScript writes objects but now used universally across virtually every programming language, regardless of whether that language is JavaScript at all. It became the dominant data-interchange format on the web because it is simultaneously easy for humans to read (once you know the rules) and easy for software to parse quickly and reliably โ a combination that its main historical rival, XML, achieved less elegantly with far more verbose syntax.
The building blocks: six data types
JSON supports exactly six data types, and every JSON document is built entirely from combinations of these: strings (text, always wrapped in double quotes โ never single quotes, which is a strict rule unlike JavaScript itself), numbers (written plainly, no quotes), booleans (true or false, lowercase, unquoted), null (representing an explicitly empty or absent value), objects (a collection of key-value pairs wrapped in curly braces), and arrays (an ordered list of values wrapped in square brackets). Every piece of data in any JSON document, however large, is one of these six things โ there is no seventh type to learn.
Reading an object
An object is a set of key-value pairs, each key a string in double quotes, followed by a colon, then the value, with pairs separated by commas, the whole thing wrapped in curly braces: {"name": "Priya", "age": 29, "active": true}. Read this left to right as a small table: the key "name" maps to the value "Priya", "age" maps to 29, "active" maps to true. Objects represent a single, self-contained thing with several named properties โ much like a row in a spreadsheet, but with named columns embedded directly in each entry rather than implied by a shared header row.
Reading an array
An array is an ordered list of values separated by commas, wrapped in square brackets: ["red", "green", "blue"] or [1, 2, 3]. Unlike an object, array values have no names โ their meaning comes purely from their position in the list. Arrays commonly hold multiple objects, representing a list of similar items โ a list of users, a list of products โ each object in the array sharing a similar (though not strictly required to be identical) set of keys.
Nesting: where it starts to look complicated
The apparent complexity of real-world JSON comes almost entirely from nesting โ objects containing arrays, which contain more objects, which contain more arrays, several levels deep. The rules do not change at any depth; each nested piece is still just one of the same six data types, following the same syntax. The trick to reading deeply nested JSON without getting lost is to work through it one level at a time: identify the outermost structure (object or array), find its immediate keys or elements, and only then look inside each one individually, rather than trying to absorb the entire nested structure in one glance. A properly indented, formatted view โ rather than a single unbroken line โ makes this level-by-level reading dramatically easier, since indentation visually marks each nesting level.
Turning a minified blob into something readable
JSON sent over an API or stored in a log file is frequently minified โ all whitespace and line breaks stripped out to save bandwidth โ which makes it compact for machines but nearly unreadable for a human trying to inspect it, since a deeply nested structure collapses into one long, undifferentiated line. The JSON Formatter takes minified JSON and instantly re-indents it with proper line breaks and nesting-level indentation, turning an unreadable blob into a clearly structured, browsable document, and can also validate the syntax and point out exactly where it breaks if the JSON is malformed.
Common syntax mistakes
A handful of small syntax errors account for most invalid JSON. Using single quotes instead of double quotes around strings and keys โ valid in JavaScript object literals but strictly invalid in JSON, which requires double quotes everywhere. A trailing comma after the last item in an object or array (a habit carried over from some other languages that tolerate it) is invalid in strict JSON and will cause a parsing error. Unquoted keys โ writing {name: "Priya"} instead of {"name": "Priya"} โ is likewise valid casual JavaScript but invalid JSON. A good formatter or validator catches all of these immediately and points to the specific location of the problem, which is far faster than scanning a long minified string by eye looking for a missing quote.
Where you will encounter JSON
Beyond API responses, JSON appears in browser localStorage and sessionStorage (where web apps persist small amounts of data on your device), in configuration files for countless developer tools, in the payload of a decoded JWT (see how a token's readable JSON payload sits between its Base64-encoded segments), and increasingly as the format many no-code and low-code tools use under the hood for import/export. Recognising JSON on sight, and being comfortable reading it without a tool when you need to, is a broadly transferable skill across almost every area of modern software work.
Key takeaways
- JSON has exactly six data types: strings, numbers, booleans, null, objects, and arrays โ nothing else.
- Objects are key-value pairs in curly braces; arrays are ordered lists in square brackets โ read nested structures one level at a time.
- Strings and keys must use double quotes, never single quotes, and trailing commas are invalid.
- A formatter turns minified JSON into readable, indented structure and catches syntax errors precisely.