What Is JSON? A Complete Beginner's Guide

Everything You Need to Know About JavaScript Object Notation

What Is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data format used to store and exchange structured information. It was derived from JavaScript object syntax by Douglas Crockford in the early 2000s and was formally specified as RFC 8259 in 2017. Despite its JavaScript origins, JSON is language-independent and is supported natively by virtually every modern programming language.

JSON has become the dominant data interchange format on the web, surpassing XML in most applications. It is used by REST APIs, configuration files, databases (such as MongoDB and PostgreSQL's JSONB type), and messaging systems. Its popularity stems from a simple design philosophy: be human-readable, machine-parseable, and as minimal as possible.

A Brief History

Douglas Crockford identified a subset of JavaScript's literal notation that could serve as a standalone data format around 2001. He registered the domain json.org and published the grammar on a single page. The format gained rapid adoption because web developers were already familiar with the syntax from JavaScript. By 2006, JSON had its first RFC (RFC 4627), and by the 2010s it had effectively replaced XML as the default format for web APIs.

JSON Syntax Rules

JSON follows a small set of strict rules:

JSON Data Types

JSON supports exactly six data types:

1. String

A sequence of Unicode characters wrapped in double quotes.

"name": "Alice Johnson"

2. Number

An integer or floating-point number. JSON does not distinguish between int and float.

"age": 28, "temperature": 36.6

3. Boolean

Either true or false (lowercase, unquoted).

"isActive": true

4. Null

Represents an empty or unknown value.

"middleName": null

5. Array

An ordered list of values enclosed in square brackets.

"colors": ["red", "green", "blue"]

6. Object

An unordered collection of key-value pairs enclosed in curly braces.

"address": { "street": "123 Main St", "city": "New York" }

A Complete JSON Example

Here is a realistic JSON document combining all six data types:

{ "id": 1042, "name": "Alice Johnson", "email": "alice@example.com", "isVerified": true, "age": 28, "phone": null, "roles": ["admin", "editor"], "address": { "street": "123 Main St", "city": "New York", "zip": "10001" } }

You can paste this into our JSON Formatter to see it pretty-printed with syntax highlighting, or use the JSON Validator to confirm it is valid.

Real-World Use Cases

Try Our Free JSON Tools

Now that you understand JSON, try working with it using our free, browser-based tools:

Want to compare JSON with other data formats? Read our JSON vs XML vs YAML comparison guide.

Frequently Asked Questions

What does JSON stand for?

JSON stands for JavaScript Object Notation. Despite the name, JSON is language-independent and is used by virtually every modern programming language, including Python, Java, C#, Go, Ruby, PHP, and many more.

Is JSON the same as JavaScript?

No. JSON is a data format inspired by JavaScript object syntax, but it is a standalone specification (RFC 8259). JSON is stricter than JavaScript: it requires double quotes for strings and keys, does not allow comments, and does not support functions or undefined values.

What data types does JSON support?

JSON supports six data types: strings (text in double quotes), numbers (integers and decimals), booleans (true or false), null, arrays (ordered lists in square brackets), and objects (key-value pairs in curly braces).

Why is JSON so popular?

JSON is popular because it is lightweight, human-readable, and natively supported by JavaScript (the language of the web). It is simpler than XML, requires less markup, and is easy to parse in every major programming language. Most REST APIs and web services use JSON as their default data format.