Home › Articles › JSON for Beginners: How Developers Use It Every Day
JSON for Beginners: How Developers Use It Every Day
JSON (JavaScript Object Notation) is a text format for structured data — think of it as a universal shipping label that almost every app, website, and API in the world can read. When your weather app shows tomorrow's forecast, when a website loads your account details, when two services talk to each other, the data almost certainly travels as JSON. It looks like this: {"name": "Ada", "age": 36, "subscribed": true}. That's it — names in quotes, values after colons, commas between pairs.
This guide teaches you to read JSON confidently, write valid JSON without the classic mistakes, and understand where developers actually use it — APIs, config files, and data storage — with examples you can paste into our free formatter to experiment.
The six building blocks
JSON has exactly six kinds of values:
| Type | Example | Notes |
|---|---|---|
| String | "hello" | Always double quotes, never single |
| Number | 42, 3.14 | No quotes; integers and decimals |
| Boolean | true, false | Lowercase, no quotes |
| Null | null | Means "no value" |
| Object | {"key": "value"} | Curly braces; key–value pairs |
| Array | [1, 2, 3] | Square brackets; ordered list |
Everything in JSON is built from these six. Objects and arrays nest inside each other to describe complex things: a user with a list of orders, each order with a list of items. If you can read nested braces and brackets, you can read any JSON ever written.
Reading a real example
{"city": "Chicago", "temp_f": 54, "conditions": "cloudy", "forecast": [{"day": "Tue", "high": 58}, {"day": "Wed", "high": 61}]}Read it as: an object with a city (string), a temperature (number), conditions (string), and a forecast — an array of two objects, each with a day and a high. That's exactly the shape apps consume thousands of times a day.
Notice the commas: between pairs, never after the last one. That trailing comma is the single most common JSON mistake — valid in JavaScript, invalid in JSON, and the reason a file that "looks right" fails to parse.
The mistakes that break JSON (and how to spot them)
- Trailing commas after the last item in an object or array.
- Single quotes instead of double quotes around strings and keys.
- Unquoted keys — JavaScript allows {name: "Ada"}; JSON requires {"name": "Ada"}.
- Comments — JSON has no comment syntax. (Some tools accept a dialect called JSON5 or JSONC, but strict JSON doesn't.)
- Numbers as strings — "42" is text, not a number; code expecting math will misbehave or crash.
- Unescaped characters — quotes and backslashes inside strings must be escaped with a backslash.
When JSON breaks, don't eyeball it — validate it. Paste it into our JSON Formatter and it will highlight the exact line where parsing fails, then pretty-print the fixed version with proper indentation.
Where developers actually use JSON
- APIs. The dominant use: apps request data from servers and receive JSON. Nearly every public API — weather, maps, payments, social platforms — speaks JSON.
- Configuration files. Tools store settings as JSON (package.json in JavaScript projects, editor settings, app configs) because it's readable by both humans and machines.
- Data storage and exchange. Document databases like MongoDB store JSON-like documents; data pipelines pass JSON between systems that were written in different languages.
- Logging and analytics. Structured JSON logs are searchable in ways plain-text logs aren't.
JSON won because it's simple, language-neutral, and readable. XML came before it and was verbose; JSON said the same things with half the characters and no closing tags, and the industry switched within a few years.
JSON vs. JavaScript objects: the confusion to avoid
JSON was inspired by JavaScript object syntax, which is why they look alike — but JSON is a text format, not code. The differences that bite beginners: JSON keys must be double-quoted strings, JSON can't contain functions or undefined values, and JSON doesn't allow trailing commas or comments. Every programming language can parse JSON into its own native structures (Python dicts, Java maps, Go structs), which is the whole point: write it once, read it anywhere.
Try it yourself in two minutes
- Copy the weather example above into the JSON Formatter and format it — watch the nested structure become readable.
- Break it on purpose: remove a comma or add a trailing one, and see the error message pinpoint the problem.
- Write a tiny object describing yourself: name, city, a list of hobbies, a boolean. Validate it.
That loop — write, validate, fix — is genuinely how developers work with JSON every day. The format is small; the habit of validating early is the skill.
JSON in the wild: three places you'll meet it this week
Once you can read JSON, you'll start seeing it everywhere. Browser developer tools: open the Network tab on any website and you'll watch JSON responses arrive as the page loads — that's the app fetching its data. App settings and exports: many apps export your data as JSON (your photos metadata, your playlists, your notes), which is why "export my data" so often produces a .json file. Smart home and automation: tools like IFTTT, Zapier, and home-automation systems pass JSON between services to trigger actions.
In each case the skill is the same one this guide taught: identify the objects, arrays, and values; check the commas and quotes; validate before you trust it. Developers aren't doing anything more exotic than that — they just do it at scale, with formatters and validators catching the trailing commas so humans don't have to.
Frequently asked questions
What does JSON stand for?
JavaScript Object Notation. It was derived from JavaScript's object syntax in the early 2000s, but it's now a language-independent standard (ECMA-404 / RFC 8259) used by virtually every programming language.
Is JSON a programming language?
No. JSON is a data format — it describes information but contains no logic, functions, or instructions. Programs parse JSON into their own data structures and then act on it.
Why do I get 'unexpected token' errors with JSON?
Almost always one of: a trailing comma, single quotes instead of double, an unquoted key, or a comment in the file. A validator/formatter will point at the exact character where parsing failed.
What's the difference between JSON and XML?
Both describe structured data, but JSON is more compact and maps directly onto common data structures (objects and arrays). XML uses opening/closing tags and supports attributes and namespaces, which suits documents; JSON suits data exchange, which is why APIs standardized on it.