# JavaScript Object Notation (JSON)

> A plain text format for data, made of names and values. Most APIs use it.

**Field:** Software Development  
**Category:** Files & Formats  
**Also known as:** JSON, JSON file

## Think of it like

Think of it like a form with labels and blanks. Each label has its answer right next to it.

## Definition

JSON is a plain text way to write down data so programs can swap it. It uses names and values in curly brackets, like "age": 36. It can hold text, numbers, true or false, null, lists and nested groups. Almost every language can read and write it. Most web APIs send and receive their data as JSON.

## Example

Jack's app asks a weather API for London. The reply is JSON with the temperature, the wind and the chance of rain.

## Example code

```json
{
  "name": "Emma",
  "age": 36,
  "admin": true,
  "skills": ["Python", "Git"]
}
```

Text, a number, a true or false value and a list, all in one object.

## Why it matters

JSON is the common language of the web. If two programs talk, it is very likely in JSON.

## Common mistake

Leaving a comma after the last item. JSON does not allow it, and the whole file fails to load.

## Three principles

- **Names and values.** Each value has a label in quotes.
- **Plain text.** People and programs can both read it.
- **Strict rules.** One stray comma breaks the file.

## Related terms

- [YAML Ain't Markup Language (YAML)](https://learn.benibix.com/term/development/yaml)
- [Extensible Markup Language (XML)](https://learn.benibix.com/term/development/xml)
- [Dictionary](https://learn.benibix.com/term/development/dictionary)
- [JavaScript](https://learn.benibix.com/term/development/javascript)
- [JSON Schema](https://learn.benibix.com/term/development/json-schema)
- [Serialization](https://learn.benibix.com/term/development/serialization)

## Told apart from

- [JSON vs XML](https://learn.benibix.com/compare/json-vs-xml): Both hold data as plain text. JSON uses names and curly brackets; XML wraps each value in tags, which makes it longer.
- [JSON vs YAML](https://learn.benibix.com/compare/json-vs-yaml): YAML uses indents and allows comments, so it suits settings files. JSON uses brackets and is the usual choice for APIs.
- [JSON vs Protocol Buffers](https://learn.benibix.com/compare/json-vs-protocol-buffers): People think Protobuf is just a faster JSON, and it is not. JSON carries its own field names, so anyone can read it with no setup. Protobuf sends only numbered fields as bytes. Both sides need the same .proto file to make sense of them. You trade easy reading for small, fast messages.

## Taught in

- [Structured Output and JSON](https://learn.benibix.com/learn/ai-working-with-ai/structured-output-and-json): Prompt Engineering, 10/16
- [JSON, XML and CSV](https://learn.benibix.com/learn/development-formats/json-xml-and-csv): File Formats, 3/11
- [Fetch API and JSON](https://learn.benibix.com/learn/development-web/fetch-api-and-json): HTML, CSS and JS, 13/14

---

Source: https://learn.benibix.com/term/development/json
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-18
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
