What Is JSON? Simple Explanation, Examples and Uses
JSON stands for JavaScript Object Notation. It is a lightweight data format used to store and exchange structured information between apps, APIs and systems.
- JSON stores data as key-value pairs.
- JSON is widely used in APIs and web applications.
- JSON is easy for humans to read and machines to parse.
- JSON supports objects, arrays, strings, numbers, booleans and null.
What does JSON mean?
JSON means JavaScript Object Notation. Although it came from JavaScript, JSON is now used across many programming languages.
JSON is popular because it is compact, readable and works naturally with modern web APIs.
Simple JSON example
Here is a simple JSON object:
{
"name": "Jane Smith",
"role": "Chief Cheese Tester",
"active": true
}
This JSON object has three properties: name, role and active.
How JSON works
JSON is built from simple data structures.
| JSON type | Example |
|---|---|
| String | "Chief Cheese Tester" |
| Number | 42 |
| Boolean | true or false |
| Object | { "name": "Jane" } |
| Array | [ "XML", "JSON", "Cheese" ] |
| Null | null |
JSON object example
A JSON object groups related values together using key-value pairs.
{
"product": "Cheese Bridge Mug",
"price": 12.99,
"inStock": true
}
JSON array example
A JSON array stores multiple values in order.
{
"tools": [
"JSON Formatter",
"JSON Viewer",
"XML to JSON Converter"
]
}
Nested JSON example
JSON can contain nested objects and arrays.
{
"company": {
"name": "CheeseBridge",
"team": [
{
"name": "Mia Cheese",
"role": "Bridge Snack Coordinator"
}
]
}
}
What is JSON used for?
| Use case | Example |
|---|---|
| APIs | Sending data between frontend and backend systems. |
| Web apps | Loading user profiles, settings and product data. |
| Configuration files | Storing application settings. |
| Data storage | Saving structured data in files or databases. |
| Integrations | Exchanging data between software systems. |
JSON vs XML
JSON and XML are both used to represent structured data. JSON is usually shorter and common in modern web APIs. XML is more verbose but supports attributes, namespaces and schema validation.
Read the full comparison: JSON vs XML
Common JSON mistakes
- Using single quotes instead of double quotes.
- Leaving a trailing comma after the last item.
- Forgetting a comma between properties.
- Using comments inside JSON.
- Not wrapping property names in double quotes.
Invalid JSON example
{
"name": "Jane Smith",
"role": "Chief Cheese Tester",
}
The example above is invalid because the last property has a trailing comma.
Format or view JSON online
Use CheeseBridge JSON tools to format, view and inspect JSON directly in your browser.
Open JSON Formatter Open JSON Viewer Open XML to JSON Converter Open JSON to XML ConverterTrusted JSON references
For official and technical references, see:
Frequently asked questions
Is JSON a programming language?
No. JSON is a data format. It stores structured data but does not perform logic like a programming language.
Why is JSON used in APIs?
JSON is commonly used in APIs because it is lightweight, readable and easy for many programming languages to parse.
Can JSON contain arrays?
Yes. JSON arrays are used to store ordered lists of values, objects or other arrays.