TOON specification v4.1
The JSON → TOON converter that tells you when not to use TOON.
Every other converter promises you 30–60% fewer tokens. That is true for flat, uniform arrays — and wrong for deeply nested data, where minified JSON usually wins. This one measures your actual payload and says so.
TOON is worth it here
41% fewer tokens than minified JSON
| Format | Tokens | vs. minified |
|---|---|---|
| TOONcheapest | 210 | −41% |
| JSON (minified) | 353 | — |
| JSON (indented) | 618 | +75% |
- Your records are uniform and flat — exactly the shape TOON’s tabular form is built for.
What this costs you
Saves $35.75 per month at this payload size.
Input tokens only, and it ignores the tokens spent teaching the model TOON’s syntax — on short prompts that overhead can exceed the saving.
Shape: tabular-nested · depth 4 · 14 records, 100% uniform
JSON
{
"status": "ok",
"page": 1,
"total": 214,
"data": [
{
"id": 1001,
"name": "user_0",
"role": "admin",
"signups": 10,
"active": false
},
{
"id": 1002,
"name": "user_1",
"role": "member",
"signups": 13,
"active": true
},
{
"id": 1003,
"name": "user_2",
"role": "member",
"signups": 16,
"active": true
},
{
"id": 1004,
"name": "user_3",
"role": "admin",
"signups": 19,
"active": true
},
{
"id": 1005,
"name": "user_4",
"role": "member",
"signups": 22,
"active": false
},
{
"id": 1006,
"name": "user_5",
"role": "member",
"signups": 25,
"active": true
},
{
"id": 1007,
"name": "user_6",
"role": "admin",
"signups": 28,
"active": true
},
{
"id": 1008,
"name": "user_7",
"role": "member",
"signups": 31,
"active": true
},
{
"id": 1009,
"name": "user_8",
"role": "member",
"signups": 34,
"active": false
},
{
"id": 1010,
"name": "user_9",
"role": "admin",
"signups": 37,
"active": true
},
{
"id": 1011,
"name": "user_10",
"role": "member",
"signups": 40,
"active": true
},
{
"id": 1012,
"name": "user_11",
"role": "member",
"signups": 43,
"active": true
},
{
"id": 1013,
"name": "user_12",
"role": "admin",
"signups": 46,
"active": false
},
{
"id": 1014,
"name": "user_13",
"role": "member",
"signups": 49,
"active": true
}
]
}TOON
status: ok
page: 1
total: 214
data[14]{id,name,role,signups,active}:
1001,user_0,admin,10,false
1002,user_1,member,13,true
1003,user_2,member,16,true
1004,user_3,admin,19,true
1005,user_4,member,22,false
1006,user_5,member,25,true
1007,user_6,admin,28,true
1008,user_7,member,31,true
1009,user_8,member,34,false
1010,user_9,admin,37,true
1011,user_10,member,40,true
1012,user_11,member,43,true
1013,user_12,admin,46,false
1014,user_13,member,49,trueQuestions worth asking before you switch
Every number below is measured by the analyzer on this page, at build time, from the sample payloads you can load into the converter yourself.
Is TOON actually worth it?
It depends entirely on the shape of your data, which is why this page measures yours instead of quoting an average. On a typical API response — a uniform record array inside an envelope — TOON uses 41% fewer tokens than minified JSON (210 vs 353, counted with OpenAI's o200k tokenizer). On a deeply nested configuration object it uses 21% more tokens than minified JSON (81 vs 67). The widely quoted "30–60% savings" describes the first case and silently assumes the second never happens.
When should I not use TOON?
Three cases. First, deeply nested or irregular data: there is no repeated key set for the tabular header to amortise, and minified JSON wins — 21% more tokens in the config example above. Second, records containing an array or object field: a single non-primitive field drops TOON out of its tabular form into a list that repeats every key, costing 33% more tokens than minified JSON. Third, short prompts: the tokens spent explaining TOON's syntax to the model can exceed everything the format saves.
Is CSV better than TOON for tabular data?
For a flat array of records where every field is a primitive, yes. In the plain-table example CSV needs 163 tokens against TOON's 195 and minified JSON's 338. TOON's advantage appears when CSV cannot represent the payload at all: an envelope around the records (status, pagination, metadata), several arrays in one document, or mixed value types. This converter only offers CSV as a comparison when it would be lossless — a CSV of just the record array would silently drop the surrounding fields.
How does TOON handle nested data?
It encodes it, but without the tabular form that produces the savings. TOON's compact syntax declares field names once and streams rows underneath, which requires every record to share one key set of primitive values. Nested values fall back to a YAML-style indented list that repeats each key per record. The output is still valid and still round-trips, it is simply no longer cheaper than JSON.
Are the token counts exact?
For OpenAI models, yes: GPT-4o, GPT-4.1 and GPT-5 use the o200k_base encoding and GPT-3.5 uses cl100k_base, both computed in your browser with the real tokenizer. For Claude and Gemini, no. Anthropic and Google do not publish an offline tokenizer — Anthropic exposes counting only through its /v1/messages/count_tokens endpoint — so those figures are estimates scaled from an OpenAI count, and the interface labels them as such.
Is my data uploaded anywhere?
No. Conversion, token counting and analysis all run in your browser as JavaScript. The server sends static HTML and never receives the JSON you paste. There is no account, no logging of payloads and no third-party analytics script reading the editor contents.
What is TOON?
TOON (Token-Oriented Object Notation) is a line-oriented, indentation-based encoding of the JSON data model, designed to spend fewer tokens when structured data is put into an LLM prompt. It combines YAML-style indentation for nesting with a CSV-style tabular form for uniform arrays, declaring field names once and streaming records as rows. This converter implements the official specification, version 4.1.