Skip to content
IT glossary
ProgrammingUpdated December 3, 2026

JSON

A text format for storing and exchanging data. It represents values such as names, numbers, and lists in a form that programs written in different languages can read.

What JSON is

JSON stands for JavaScript Object Notation, but it isn't limited to JavaScript. It's a way to write structured data as plain text. A server can send a shopping cart as JSON, for example, and a client written in a different language can read the same field names, quantities, and lists without knowing how the server represents them in memory.

What the format allows

JSON has six kinds of values: objects, arrays, strings, numbers, booleans, and null. An object holds named values between curly braces. An array holds an ordered list between square brackets. Either can contain other objects and arrays. A document contains one top-level value, so [], false, and "ready" are all valid JSON on their own.

Object names and string values use double quotes. A colon separates a name from its value; commas separate neighboring members or items. Standard JSON has no comments or trailing commas. Array order is part of the data, but applications should not depend on object member order. Keep names unique within an object: parsers don't all handle duplicates the same way.

Example: reading a response

{
  "orderId": "9007199254740993",
  "items": [{ "sku": "MUG-BLUE", "quantity": 2 }],
  "shipped": false,
  "shippedAt": null
}

The items value is an array containing one object. The shippedAt field is present and explicitly set to null. If that field were missing instead, the API could assign it a different meaning, such as “shipment information wasn't included in this response.” JSON itself doesn't decide what either case means.

A sender serializes its data into JSON text. A receiver parses the text into values it can work with. In JavaScript, JSON.stringify() and JSON.parse() do those jobs. Parsing checks syntax, not whether a payload meets an application's requirements. For instance, a parser accepts "quantity": "two" inside an object; the application still needs to check that quantity is a positive integer.

Where it fits and what interviewers look for

JSON is common in HTTP APIs, event messages, configuration files, and structured logs. An HTTP response typically labels a JSON body with Content-Type: application/json. JSON does not have built-in types for dates or binary data, so the sender and receiver need to agree on how to represent them, such as a timestamp string in a specified format.

A common interview question is why the example uses quotes around a numeric-looking order ID. The unquoted token would be a valid JSON number, but JavaScript's default parser would round it because Number cannot represent that integer exactly. Keeping the ID as a string preserves every digit. The distinction is useful beyond interviews: valid JSON syntax doesn't guarantee that every client will interpret a value the way the sender intended.