JSON (JavaScript Object Notation) is a simple text format for writing down structured information, such as a customer's name, an order's items or a list of opening hours, so that two programs can pass it back and forth. It is readable by people and easy for almost any programming language to parse.
How JSON is put together
JSON has only a few building blocks. An object is a set of key and value pairs inside curly braces. An array is an ordered list inside square brackets. Values can be strings in double quotes, numbers, true, false, null, or another object or array. A shop order might look like this:
{"orderId": 1042, "paid": true, "items": [{"sku": "MUG-01", "qty": 2}], "note": null}
The rules are strict, which is what makes JSON reliable. Keys must be in double quotes, single quotes are not allowed, and there are no comments and no trailing comma after the last item. The format is defined in RFC 8259 and ECMA-404. It borrowed its syntax from JavaScript, but it is language-independent.
Where you meet JSON
When a site asks an API for data, the answer usually comes back as JSON. Payment providers send webhook events as JSON. Developer projects keep settings in JSON files such as package.json. And the JSON-LD format Google recommends for structured data is JSON placed inside a script tag that describes your business, products or events.
An example: opening hours from a booking tool
A hair salon's site shows "Open now" in the header. Behind it, the page requests the salon's hours from its booking software, which replies with JSON listing each weekday with an open and close time. The page compares the current time with today's entry and shows the right label. Change the hours in the booking tool and the website follows without anyone editing it.
When owners run into it
Most owners only see JSON when setting up an integration, pasting schema markup, or reading an export from a form tool. Knowing the format helps you spot when a pasted snippet is broken before it silently stops working.
Common JSON mistakes
- Trailing commas. A comma after the last item makes the whole document invalid.
- Curly quotes from word processors. Copying JSON through a document editor can swap straight quotes for typographic ones.
- Numbers stored as text.
"19.99"and19.99are different types, which breaks sums and comparisons. - Putting secrets in public JSON files. Anything the browser downloads can be read by anyone.
Related terms
- API: the most common source of JSON responses.
- REST API: a style of API that usually speaks JSON.
- Webhook: sends event details as JSON.
- Structured data: often written in JSON-LD for search engines.