JSON (JavaScript Object Notation)
- Standard term
JSON (JavaScript Object Notation) is a plain-text format for structured data: labeled fields paired with values, grouped in curly braces. Programs use it to pass information back and forth, and people can read it too.
In {"payee": "Water company", "amount": 42.10}, the names and the text go in quotes and the number goes bare, so a program can do math on the amount. Braces and square brackets can nest, so one record can hold a list of others. A program asks for each value by name, never guessing where the amount sits in a sentence.
Where you’ll meet it
Your team has an AI step that reads order emails and adds each order to a shared spreadsheet. Some days it replies with a tidy sentence, other days with a list, and the step that fills the spreadsheet breaks whenever the wording changes.
What to do
Change the AI step's instructions to answer in JSON with fixed field names, such as customer, item, quantity as a number, and order date, with a list when one email holds several orders. Then test it on past emails, including one with several orders and one missing a field.
Easy to mix up
| JSON (JavaScript Object Notation) | API |
|---|---|
| How the message is written | The rules for what a program can ask for and get back |
Check yourself
Your AI returns forty orders as JSON, and the closing bracket at the very end is missing. What will the next step most likely get?
Go deeperA reply can be valid JSON and still hold the wrong data
Douglas Crockford named and described JSON in the early 2000s, borrowing the way JavaScript writes objects, and it is standardized as ECMA-404 and RFC 8259. Most web services now send and receive it, though each chooses its own field names and structure.
A valid reply can still break the next step, with an amount sent as text, "42.10", where a number was expected, or with a field missing. A schema, a written list of each field and its type, lets code reject those on arrival. Many AI services also accept one in a setting often called “structured output,” and make the model's reply match it.
JSON has no date type and no comments, so dates travel as text in an agreed format. The format itself sets no limit on numbers, and many programs store them as floating-point values, which hold only about 16 digits of precision, so very large IDs can quietly round.