What is JSON?
JSON is how apps write structured data as text. Here are its six building blocks, examples from an API, a save file and a level, and the errors that trip people up.

Key takeaways
- JSON writes data as labeled values in plain text: objects in braces, lists in brackets.
- It has six value types: string, number, true/false, null, object and array. No dates, no comments.
- APIs, webhooks, config files, game saves and levels all commonly use it.
Short for JavaScript Object Notation, JSON is a plain-text way to write structured data, labels paired with values, nested as deep as you need, so that any program in any language can read it. Most web APIs speak it, and many apps and games store settings, saves and levels in it.
A filled-in paper form is a good mental picture. Each field has a label ("Name", "Age") and an answer, some answers are lists ("Allergies: nuts, shellfish"), and a section can contain sub-sections. JSON is that form written as text.
The six building blocks
- String: text in double quotes, "Lisbon".
- Number: 42, 3.14, -7. No quotes.
- Boolean: true or false.
- null: "no value", different from 0 or an empty string.
- Object: labeled values in braces, { "name": "Ana", "level": 7 }. Labels (keys) are always double-quoted strings.
- Array: an ordered list in brackets, [ "sword", "potion", "map" ].
That is the whole language. Everything else is nesting: objects inside arrays inside objects.
Three places you will see it
An API response
Ask a weather service for a forecast and the reply might be `{ "city": "Lisbon", "tomorrow": { "high": 21, "low": 14, "rain_chance": 0.1 } }`. The app reads tomorrow.high and shows 21. More in what is an API.
A game save
`{ "version": 3, "coins": 1250, "unlocked": ["forest", "caves"], "settings": { "music": 0.6, "haptics": true } }`. The version field matters: when you change the save shape later, old saves can be upgraded instead of crashing the game (saving game progress).
A level
Levels are often JSON too: a grid of tile numbers, plus a list of objects such as { "type": "spike", "x": 12, "y": 4 }. Data-driven levels mean a designer can edit content without touching game code.
Mistakes that break JSON
- 01A trailing comma after the last item, [1, 2, 3,], is invalid, even though JavaScript allows it.
- 02Single quotes. Strings and keys need double quotes.
- 03Comments. JSON has none. Use a "note" field, or a format that allows comments for config.
- 04Dates. There is no date type. Store ISO strings like "2026-11-22T09:30:00Z" and convert on read.
- 05Big numbers. IDs longer than about 15 to 16 digits can lose precision in JavaScript. Store long IDs as strings.
JSON when building with Startbase
You will see JSON in function test results, logs and webhook payloads, and Startbase Cloud's Postgres database can store it in jsonb columns. That is handy for flexible extras (a user's settings blob), but data you filter or join on usually belongs in real columns (database basics). Pasting a JSON sample into your brief is one of the clearest ways to tell the agent the exact shape you want.
Save progress as JSON in this shape: { "version": 1, "coins": number, "bestTimes": { levelId: seconds }, "unlocked": [levelId], "settings": { "music": 0 to 1, "sfx": 0 to 1 } }. When the version changes, upgrade old saves instead of resetting them, and fall back to defaults if the save cannot be parsed.
Common confusions
- JSON vs a JavaScript object. They look alike, but JSON is text with stricter rules; code turns one into the other with JSON.parse and JSON.stringify.
- JSON vs a database. A JSON file is fine for a save; shared data many users edit at once belongs in a database schema.
- JSON vs CSV. CSV is a flat table; JSON handles nesting and lists inside records.
Frequently asked questions
Is JSON a programming language?
No. It is a data format: it describes values but cannot run anything. It came from JavaScript syntax but is used by nearly every language.
Can JSON have comments?
Standard JSON cannot. Some tools accept variants with comments for config files, but data sent between programs should be plain JSON.

