Skip to main content

JSON

JSON is a lightweight, text-based data interchange format using objects and arrays, and the dominant payload format for web APIs.

JSON, short for JavaScript Object Notation, is a text-based format for representing structured data. Despite its origin in JavaScript, it is language-independent and is the dominant interchange format for web APIs.

How It Works

JSON builds data from a few primitives: strings, numbers, booleans, and null, composed into two structures, objects and arrays. An object is an unordered set of key-value pairs wrapped in braces; an array is an ordered list wrapped in brackets. These nest freely, allowing complex data to be expressed in plain text that both humans and machines can read.

Nearly every programming language ships parsers and serializers for JSON. Related standards extend it: JSON Schema validates structure, JSON Lines stores one record per line for streaming, and JSON Web Tokens encode signed claims.

Why It Matters

JSON's simplicity drove its adoption over heavier formats like XML for most web communication. It is easy to read, maps cleanly to data structures in modern languages, and is natively supported in browsers. It is the default payload format for REST APIs, GraphQL responses, configuration files, and document databases.

JSON has limits. As text, it is larger and slower to parse than binary formats such as Protocol Buffers, which matters in high-throughput internal systems. It has no native date or binary type and no comments, so configuration use cases sometimes prefer YAML or formats like JSON5. For most public APIs, however, its readability and ubiquity make it the natural choice.

Related Terms

JSON is the standard payload for REST and is described by OpenAPI and JSON Schema; it is often compared with binary formats like Protocol Buffers.