# JSON

> The plain-text format programs use to hand each other structured data.

- Level: Basic
- Topics: Software
- URL: https://tidbit.legios.com.ar/json/
- In Spanish: [JSON](https://tidbit.legios.com.ar/es/json/)

**JSON** (JavaScript Object Notation, said "jason") is a text format for writing structured data: names with values, lists, and nested groups of them. A user might be `{"name": "Ana", "age": 31, "languages": ["es", "en"]}`. Humans can read it, every programming language can parse it, and it takes one line of code to turn it into an object you can work with.

It was born inside JavaScript in the early 2000s and spread because it is far simpler than XML, the format it replaced. Today nearly every web API answers in JSON, many configuration files are JSON (`package.json`, `tsconfig.json`), and databases like Amazon DynamoDB or MongoDB store documents that are essentially JSON.

It has only six kinds of value: string, number, true/false, null, array (`[...]`) and object (`{...}`). No dates, no comments, no trailing commas. That strictness is why it is so portable, and also why a single missing quote breaks the whole file. When size or speed matter more than readability, binary formats like Protocol Buffers or Parquet take over.

## An analogy

A filled-in form with labeled boxes. Any clerk in any office can read "Name: Ana, Age: 31" because the labels travel with the values, and a box can contain another whole form.

## Keep in mind

- Keys are strings in double quotes; values can be text, numbers, booleans, null, lists or objects.
- It is the default response format of web APIs.
- Every major language has a built-in JSON parser.
- Strict syntax: one stray comma makes the file invalid.

## Go deeper

- [Introducing JSON (json.org)](https://www.json.org/json-en.html)
- [Working with JSON (MDN)](https://developer.mozilla.org/en-US/docs/Learn_web_development/Core/Scripting/JSON)
- [JSON (Wikipedia)](https://en.wikipedia.org/wiki/JSON)

## Related terms

- [JavaScript](https://tidbit.legios.com.ar/javascript/): The programming language that runs inside web pages and makes them interactive.
- [Programming language](https://tidbit.legios.com.ar/programming-language/): A precise, written language people use to give instructions to a computer.
- [XML](https://tidbit.legios.com.ar/xml/): A text format that wraps data in named tags, so both people and programs can read it.
- [API](https://tidbit.legios.com.ar/api/): The menu of things one program lets another program ask for.
- [Database](https://tidbit.legios.com.ar/database/): An organized store of data that programs can search and update safely.
- [Amazon DynamoDB](https://tidbit.legios.com.ar/amazon-dynamodb/): A key-value database that answers in milliseconds no matter how big the table gets.
- [Parquet](https://tidbit.legios.com.ar/parquet/): A file format that stores tables by column, compressed, so analytics reads far less.
