What Is JSON? A Beginner's Guide to JavaScript Object Notation
JSON is the universal language of data exchange on the web. Learn what JSON is, how its syntax works, where it is used, and the rules that keep it valid.
JSON — short for JavaScript Object Notation — is the most widely used data-interchange format on the modern web. If you have ever called an API, edited a configuration file, or inspected the network tab in your browser, you have almost certainly seen JSON. This guide explains what it is, why it became ubiquitous, and the handful of rules that make a JSON document valid.
A format built for both humans and machines
JSON is a text format for representing structured data. It was designed to be easy for people to read and write, and easy for machines to parse and generate. That dual goal is the reason it edged out heavier formats like XML for most web use cases: a JSON document looks almost exactly like the data structure it represents.
Here is a small example:
{
"name": "Ada Lovelace",
"born": 1815,
"fields": ["mathematics", "computing"],
"active": false
}
Even with no prior knowledge, you can read that: a person with a name, a birth year, a list of fields, and a boolean flag. That readability is JSON’s superpower.
The six data types
Despite its flexibility, JSON has a tiny type system. Every value is one of just six things:
- String — text in double quotes:
"hello" - Number — an integer or float:
42,3.14,-7 - Boolean —
trueorfalse - Null — the explicit absence of a value:
null - Object — an unordered set of key/value pairs in braces:
{ "key": "value" } - Array — an ordered list of values in brackets:
[1, 2, 3]
Objects and arrays can nest inside one another to any depth, which is how JSON represents complex, real-world data with such a small vocabulary.
The syntax rules that matter
Most JSON errors come from a few strict rules that trip up beginners:
- Keys must be double-quoted strings.
{ name: "Ada" }is invalid JavaScript-flavored shorthand; valid JSON requires{ "name": "Ada" }. - Strings use double quotes, never single.
'hello'is not valid JSON. - No trailing commas.
[1, 2, 3,]will fail to parse — a classic late-night bug. - No comments. Pure JSON has no
//or/* */syntax (some supersets like JSONC add them, but standard parsers reject them).
If a document obeys those rules, any compliant parser in any language will accept it.
Where JSON is used
JSON shows up nearly everywhere data moves:
- APIs return JSON responses that web and mobile apps consume.
- Configuration files like
package.json,tsconfig.json, and countless others store project settings. - Databases such as MongoDB and PostgreSQL store and query JSON documents natively.
- Localization files keep translated strings keyed by language.
- Logs and analytics stream structured events as JSON lines.
JSON vs. JavaScript objects
JSON looks like a JavaScript object literal — and it is no coincidence, since it was derived from one. But they are not the same. JSON is a string that must be parsed (JSON.parse) into a real object, and serialized (JSON.stringify) back into text. JavaScript objects can hold functions, undefined, and other things JSON cannot represent. Keeping that distinction clear saves a surprising amount of debugging.
Working with multiple JSON files
As projects grow, you rarely deal with a single JSON document. You merge configuration layers, combine API responses, or consolidate translation files. Doing this by hand is slow and error-prone — a single misplaced comma breaks everything. That is exactly the problem our JSON merge tool solves: combine multiple files or snippets in your browser, with validation that catches mistakes before they cost you time.
Key takeaways
JSON is a lightweight, text-based format with six data types and a handful of strict syntax rules. Its readability and universality made it the default language of data exchange on the web. Once you internalize the rules — quoted keys, double quotes, no trailing commas — JSON becomes second nature. And when you need to combine several JSON documents, merging them online is faster and safer than editing by hand.
Ready to merge your JSON?
Combine files or snippets in your browser — free and private.
Open the merge toolKeep reading