# JSON (JavaScript Object Notation)

URL: https://softwaredictionary.org/terms/json
Category: Backend & APIs
Last updated: 2026-09-29
Pronunciation: JAY-sun

In short: JSON is a lightweight, text-based format for storing and exchanging structured data as key-value pairs and lists, readable by both humans and machines.

## What is JSON?

JSON is a simple way to write structured data as plain text. It uses curly braces for objects made of key-value pairs, square brackets for ordered lists called arrays, and a small set of value types: strings, numbers, booleans (`true` or `false`), `null`, objects, and arrays.

Although its syntax comes from JavaScript, JSON is language-independent, and almost every programming language can read and write it. Converting data into JSON text is called serialization, and turning JSON text back into data structures is called parsing; in JavaScript these are done with `JSON.stringify()` and `JSON.parse()`.

JSON is the default data format for most web APIs, and it is also used for configuration files such as `package.json`, for logs, and for storing documents in NoSQL databases. Its popularity comes from being compact, easy for people to read, and easy for machines to process.

JSON is often confused with JavaScript objects, but it is stricter: keys must be in double quotes, strings cannot use single quotes, and comments, trailing commas, functions, and `undefined` are not allowed. Compared with XML, JSON is shorter and maps more directly to objects and arrays in code.

## Key takeaways

- JSON stands for JavaScript Object Notation but works with almost every language.
- Data is written as objects (`{}`), arrays (`[]`), strings, numbers, booleans, and `null`.
- Keys and strings must use double quotes.
- Standard JSON does not allow comments or trailing commas.
- It is the most common data format for web APIs.

## Example: A user record written in JSON

```json
{
  "id": 42,
  "name": "Ada Lovelace",
  "email": "ada@example.com",
  "isAdmin": false,
  "roles": ["editor", "author"],
  "address": {
    "city": "London",
    "country": "UK"
  },
  "lastLogin": null
}
```

## Frequently asked questions

**What is the difference between JSON and a JavaScript object?**

A JavaScript object is a value in a running program, while JSON is a text format for representing data. JSON is also stricter: keys need double quotes, and functions, comments, and `undefined` are not allowed.

**Can JSON have comments?**

No. Standard JSON does not support comments, although some tools accept variants such as JSONC or JSON5 for configuration files.

**What is the difference between JSON and XML?**

Both are text formats for structured data. JSON is shorter and maps directly to objects and arrays in code, while XML uses opening and closing tags and is more common in older enterprise systems and document formats.

## Sources

- [RFC 8259: The JavaScript Object Notation (JSON) Data Interchange Format](https://www.rfc-editor.org/rfc/rfc8259.html)
- [ECMA-404: The JSON Data Interchange Syntax](https://ecma-international.org/publications-and-standards/standards/ecma-404/)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
