What is TOON?
TOON — Token-Oriented Object Notation — is a text format for feeding structured data to large language models. It represents exactly the same data model as JSON (objects, arrays, strings, numbers, booleans, null), but writes it in a way that tokenizes far smaller: indentation instead of braces, and tables instead of repeated keys.
Here is the same data in JSON and in TOON:
// JSON — 71 tokens (o200k)
{
"users": [
{ "id": 1, "name": "Ada", "role": "admin" },
{ "id": 2, "name": "Alan", "role": "user" },
{ "id": 3, "name": "Grace", "role": "user" }
]
}
// TOON — 32 tokens (o200k)
users[3]{id,name,role}:
1,Ada,admin
2,Alan,user
3,Grace,userWhere the savings come from
JSON repeats every field name on every array element and spends tokens on braces, quotes and commas. TOON declares the fields once in a header — users[3]{id,name,role} — then streams one row per record, like CSV. The [3] is an explicit row count and the header is an explicit schema, which is also why models tend to read TOON more reliably than raw CSV: the structure is stated, not implied.
When TOON wins — and when it doesn't
- Wins big: uniform arrays of objects — result sets, logs, product lists, embeddings metadata. Typically 30–60% fewer tokens than formatted JSON.
- Roughly even: small single objects and config-style data.
- Can lose: deeply nested, irregular structures. Measure it — the converter prints exact counts for your data.
Is it lossless?
Yes. TOON is a lossless encoding of the JSON data model: decoding TOON returns the exact original value. You can verify with the TOON to JSON converter.
Ecosystem
TOON has an open spec and a reference TypeScript SDK (this site uses it), with implementations in Python, Rust, Go, Java, .NET and more. See the official repository for the spec and benchmarks, or start with the cheat sheet.