What is JSON? A Complete Guide
5 min read
json basics guide
What is JSON?
JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format. Despite its name, JSON is language-independent — virtually every modern programming language has built-in support for reading and writing it.
JSON Syntax
JSON is built on two structures:
- Objects — A collection of key/value pairs enclosed in curly braces
{} - Arrays — An ordered list of values enclosed in square brackets
[]
{
"name": "Alice",
"age": 30,
"isAdmin": false,
"scores": [95, 87, 92],
"address": {
"city": "Istanbul",
"country": "Turkey"
}
}
Data Types
JSON supports exactly six data types:
| Type | Example |
|---|---|
| String | "hello world" |
| Number | 42, 3.14, -7 |
| Boolean | true, false |
| Null | null |
| Object | { "key": "value" } |
| Array | [1, 2, 3] |
Why Use JSON?
- Human-readable — Easy to read and write
- Compact — Less verbose than XML
- Universal — Supported by every major language and platform
- Native to JavaScript — Parsed directly with
JSON.parse()and serialized withJSON.stringify()
JSON vs Other Formats
JSON has largely replaced XML for web APIs due to its simplicity. Compared to CSV, JSON supports nested structures and mixed data types.
Ready to work with JSON? Try our JSON Beautifier to format your JSON instantly.