JSON

A lightweight, text-based data interchange format inspired by JavaScript object literal syntax but language-independent.

JSON (JavaScript Object Notation) is an open standard for representing structured data. Although it originated from JavaScript, it is a language-independent format with built-in or library support in virtually every modern programming environment. Its text-based structure makes it easy for humans to read and for machines to parse efficiently.

The format is built on two primary structures: objects (collections of name/value pairs) and arrays (ordered lists of values). It supports a specific set of data types:

  • Strings (must be enclosed in double quotes);
  • Numbers (integer or floating point);
  • Booleans (true or false);
  • Null (representing an empty value);
  • Arrays and Objects for complex nesting.

JSON is the dominant format for data exchange in RESTful APIs, web services, and microservices architecture. It has also become the standard for application configuration files, such as package.json, and serves as the primary data storage format for document-oriented databases like MongoDB.

Example and Performance

A typical JSON object: {"user_id": 501, "status": "online", "permissions": ["read"]}. Because of its minimal syntax, JSON parsing is computationally less expensive than XML parsing, leading to faster data processing and lower latency in high-load web applications and mobile clients.