What is JSON?

Article

JSON stands for JavaScript Object Notation. It is a lightweight, text-based data interchange format that is easy for humans to read and write, and easy for machines to parse and generate. Despite its name, JSON is language-independent and is supported by virtually every modern programming language.

Need to format or validate a JSON document?

Open JSON Formatter →

History

JSON was developed by Douglas Crockford in the early 2000s as a simpler alternative to XML for transmitting data between a server and a web application. It was first described in 2001 and later standardized as ECMA-404 and RFC 8259. Today it is the dominant format for web APIs and configuration files worldwide.

Basic Syntax

A JSON value is either an object, an array, a string, a number, a boolean, or null. An object is a set of key-value pairs enclosed in curly braces, where keys must be strings in double quotes. An array is an ordered list of values enclosed in square brackets.

{
  "name": "Alice",
  "age": 30,
  "active": true,
  "score": 9.5,
  "tags": ["developer", "designer"],
  "address": {
    "city": "Istanbul",
    "country": "Turkey"
  },
  "nickname": null
}

Data Types

JSON supports exactly six value types:

Common Use Cases

JSON vs XML

Before JSON, XML was the dominant format for data exchange. JSON has largely replaced XML in web development because:

XML is still preferred when document structure, namespaces, comments, or schemas (XSD) are required.

Rules to Remember

Frequently Asked Questions

What is JSON?

JSON (JavaScript Object Notation) is a lightweight, text-based data interchange format that is easy for humans to read and write and easy for machines to parse and generate. It is the most widely used format for web APIs and configuration files.

What does JSON stand for?

JSON stands for JavaScript Object Notation. Despite its name, JSON is language-independent and supported by virtually every modern programming language.

What is JSON used for?

JSON is used for data exchange in web APIs, application configuration files (such as package.json), data storage in NoSQL databases like MongoDB, and communication between services over HTTP.

What is a JSON file?

A JSON file is a plain-text file with a .json extension that contains structured data in JSON format. It can be opened and edited with any text editor.

What is the difference between JSON and XML?

JSON is shorter and easier to read than XML, requires less bandwidth and parses faster, and is natively supported in JavaScript. XML is still preferred when document structure, namespaces or schemas (XSD) are required.

Sources