What is JSON?

JSON (JavaScript Object Notation) is a way to write data as plain text, so programs can store it and send it to each other. APIs return it, config files hold it, and automation tools like n8n pass it from step to step. The name comes from JavaScript, but almost every programming language can read and write it. The format is defined in RFC 8259 and in the ECMA-404 standard.

A JSON object
{
  "name": "Ada Lovelace",
  "born": 1815,
  "mathematician": true,
  "spouse": null,
  "languages": ["English", "French"],
  "address": {
    "city": "London",
    "country": "GB"
  }
}

Open this example in j2n

The six kinds of value

Every value in JSON is one of these:

Objects and arrays can hold any value, including other objects and arrays, so data can nest as deep as it needs to. Commas go between the items of an object or array. Spaces, tabs and line breaks between values don't change the data, so the same JSON can be written on one line or spread over many.

A JSON text is usually an object or an array, but any single value counts: 42 and "hello" are valid JSON texts too. JSON shared between systems must be encoded as UTF-8.

Rules that trip people up