Skip to content
BENIBIX Learn

JavaScript Object Notation (JSON)

Development📄 Files & FormatsData Formats

Also known as JSON, JSON file

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

Think of it like

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

Example

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

Why it matters

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

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 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.

Common mistake

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

Key takeaways

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

Compare

Learn it properly