Suggest an editImprove this articleRefine the answer for “What is JSON?”. Your changes go to moderation before they’re published.Approval requiredContentWhat you’re changing🇺🇸EN🇺🇦UAPreviewTitle (EN)Short answer (EN)**JSON (JavaScript Object Notation)** is a text format for storing and exchanging data that is understandable to both humans and computers. **Key point:** JSON supports only simple data types and always uses double quotes for keys and strings.Shown above the full answer for quick recall.Answer (EN)Image**JSON** is one of the most important concepts in frontend and web development in general. Simply put: > **JSON (JavaScript Object Notation)** is a **text format for storing and exchanging data**, > understandable to both humans and computers. --- ## Example of JSON ```javascript { "name": "Oleh", "age": 25, "isAdmin": false, "skills": ["JavaScript", "React", "Node.js"], "address": { "city": "Kyiv", "zip": 123456 } } ``` > This is a regular JSON document. > Essentially it is a **string** that holds structured data. > Such data is easy to read and transmit over the network. --- ## Where JSON is used 1. **Exchanging data between the client and the server** The server sends JSON, the browser reads it: ```javascript fetch('/api/user') .then(res => res.json()) .then(data => console.log(data.name)); ``` 2. **Storing data in localStorage** ```javascript const user = { name: 'Oleh', age: 25 }; localStorage.setItem('user', JSON.stringify(user)); ``` 3. **Settings and configuration** (for example, `package.json` in Node.js projects): ```javascript { "name": "my-project", "version": "1.0.0", "scripts": { "start": "node index.js" } } ``` --- ## JSON syntax rules | Rule | Description | |---|---| | Keys are **always in double quotes** | `"name": "Oleh"` | | Strings are also **in double quotes** | `"city": "Kyiv"` | | Only simple types are supported | `string`, `number`, `boolean`, `null`, `object`, `array` | | No functions | `function() {}` → error | | No `undefined` and `Symbol` | they are ignored | | Comma between elements | but **not** after the last element | --- ## Basic JSON data types | Type | Example | |---|---| | **string** | `"Oleh"` | | **number** | `25` | | **boolean** | `true`, `false` | | **null** | `null` | | **object** | `{ "a": 1, "b": 2 }` | | **array** | `[1, 2, 3]` | --- ## Difference between JSON and JavaScript objects | Feature | JSON | JavaScript object | |---|---|---| | Keys | Only in `"double quotes"` | Can be without quotes | | Strings | Only `"double"` | `'single'` or `"double"` | | Types | Only simple ones (`string`, `number`, etc.) | Any (`function`, `undefined`, `symbol`) | | Purpose | Storing/exchanging data | Working with data in JS code | --- ## Converting between an object and JSON ```javascript const obj = { name: 'Oleh', age: 25 }; // object -> JSON const json = JSON.stringify(obj); console.log(json); // '{"name":"Oleh","age":25}' // JSON -> object const parsed = JSON.parse(json); console.log(parsed.name); // 'Oleh' ``` --- ## Summary | Parameter | JSON | |---|---| | Full name | JavaScript Object Notation | | Format | Text | | Used for | Storing and exchanging data | | Typical operations | `JSON.stringify()` and `JSON.parse()` | | Based on | JavaScript syntax | | Supported | In all languages (Python, Java, C#, Go, etc.) | --- ## In short > **JSON** is a *universal data format* > that lets you transmit complex structures (objects, arrays and so on) > as a plain text string.For the reviewerNote to the moderator (optional)Visible only to the moderator. Helps review go faster.