JSON stands for JavaScript Object Notation. Despite the name, it has nothing to do with JavaScript specifically โ it is a lightweight, human-readable text format used to store and transmit data between systems. Today, virtually every web API, mobile app, and configuration file uses JSON.
If you have ever exported data from an app, called an API, or worked with a web service, you have almost certainly encountered JSON. Understanding it is one of the most practical skills you can have when working with data.
What Does JSON Look Like?
Here is a simple example of a JSON object representing a person:
{
"name": "Sarah Chen",
"age": 34,
"isActive": true,
"email": "sarah@example.com",
"tags": ["analyst", "manager"],
"address": {
"city": "London",
"country": "UK"
}
}Even without any technical background, you can read this and understand what data it contains. That readability is one of JSON's biggest strengths.
The Six JSON Data Types
JSON supports exactly six types of values:
| Type | Example | Description |
|---|---|---|
| String | "hello" | Text, always wrapped in double quotes |
| Number | 42 or 3.14 | Integer or decimal, no quotes |
| Boolean | true or false | Logical true/false, lowercase only |
| Array | ["a", "b", "c"] | Ordered list of values in square brackets |
| Object | {"key": "value"} | Key-value pairs in curly braces |
| Null | null | Represents an empty or missing value |
JSON Syntax Rules
JSON has strict formatting rules. Breaking any of them makes the file invalid:
- Keys must be strings โ always wrapped in double quotes. Single quotes are not allowed.
- Strings must use double quotes โ
"hello"is valid,'hello'is not. - No trailing commas โ
[1, 2, 3,]is invalid JSON (the final comma causes an error). - No comments โ unlike JavaScript, JSON does not support
// commentsor/* block comments */. - No functions or undefined โ only the six data types listed above are valid.
{ name: "John" } โ this is valid JavaScript but invalid JSON. Keys must always be quoted: { "name": "John" }. JSON vs Plain Text vs XML
Before JSON became dominant, XML was the standard way to exchange data between systems. JSON replaced it in most contexts because it is:
- More compact โ less verbose syntax means smaller file sizes
- Easier to read โ humans can understand it without training
- Faster to parse โ programming languages process it more efficiently
- Natively supported โ every major programming language has built-in JSON support
Here is the same data in both formats to illustrate the difference:
// XML format
<person>
<name>Sarah Chen</name>
<age>34</age>
</person>
// JSON format
{
"name": "Sarah Chen",
"age": 34
}Where is JSON Used?
JSON appears in practically every part of modern software:
Web APIs
When you use an app on your phone that shows weather, stock prices, or social media posts, the server is almost certainly sending that data as JSON. REST APIs โ the backbone of modern web development โ use JSON as their default response format.
Configuration Files
Developers use JSON to store settings. Node.js projects use package.json to list dependencies. VS Code stores editor settings in settings.json. Many apps read their configuration from JSON files at startup.
Databases
Document databases like MongoDB and Firestore store records as JSON-like documents. PostgreSQL and MySQL both have native JSON column types that allow structured JSON storage inside relational tables.
Data Export and Import
When you export data from a CRM, analytics platform, or business tool, JSON is often one of the available formats. It preserves data types and nested structures that flat formats like CSV cannot represent cleanly.
How to Open and Read a JSON File
JSON files have the .json extension. You can open them with:
- Any text editor โ Notepad, TextEdit, VS Code, Sublime Text
- A browser โ drag the file into Chrome or Firefox for a formatted view
- Online JSON viewers โ tools that display JSON as an interactive tree
- Excel โ via Power Query (Data โ Get Data โ From File โ From JSON)
Converting JSON to Other Formats
JSON is great for machines but not always convenient for humans who need to view or analyze data. The most common conversions are:
- JSON to Excel โ for data analysis, reporting, and sharing with non-technical colleagues
- JSON to CSV โ for importing into databases or other tools
- JSON to XML โ for legacy systems that require XML input
JSON vs JSONL (JSON Lines)
You may also encounter .jsonl files. These are JSON Lines files โ each line is a separate valid JSON object. This format is popular for large datasets and log files because you can process them line by line without loading the entire file into memory.
{"id": 1, "name": "Alice"}
{"id": 2, "name": "Bob"}
{"id": 3, "name": "Carol"}Validating JSON
If you are working with JSON and something is not parsing correctly, the problem is almost always a syntax error. Common causes include:
- A missing or extra comma
- Unclosed curly brace or square bracket
- Single quotes instead of double quotes
- An unescaped special character inside a string
Use an online JSON validator (search "JSON validator") to paste your JSON and instantly identify the exact line and character causing the error.
Need to Convert JSON to Excel?
Our free tool handles arrays, nested objects, and large files โ all in your browser with no signup required.
Convert JSON to Excel Now โ