Everything You Need to Know About JavaScript Object Notation
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.
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 follows a small set of strict rules:
{} (objects) or as ordered lists inside square brackets [] (arrays).true/false), null, objects, or arrays.JSON supports exactly six data types:
A sequence of Unicode characters wrapped in double quotes.
An integer or floating-point number. JSON does not distinguish between int and float.
Either true or false (lowercase, unquoted).
Represents an empty or unknown value.
An ordered list of values enclosed in square brackets.
An unordered collection of key-value pairs enclosed in curly braces.
Here is a realistic JSON document combining all six data types:
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.
settings.json), npm (package.json), and TypeScript (tsconfig.json) use JSON for configuration.JSON.parse() and serialize objects with JSON.stringify(), making it ideal for client-server communication.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.
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.
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.
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).
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.