TOON Benchmarks 2026: Token Savings and Accuracy by Model
TOON benchmarks vs JSON across 5,856 LLM calls: 42.6% fewer tokens at 72.2% vs 71.4% retrieval accuracy, with per-model and per-data-shape results.
The current official TOON benchmark (v4.1, 5,856 LLM calls across four models) shows TOON using 42.6% fewer tokens than JSON while scoring 72.2% retrieval accuracy vs JSON's 71.4%. Accuracy is effectively tied. The win is efficiency: 29.2 accuracy points per 1,000 tokens, compared to JSON's 16.6.
Benchmark Methodology: What Was Tested
The benchmark is reproducible and fully documented at toonformat.dev/guide/benchmarks, with raw results in the retrieval-accuracy and token-efficiency reports. The test matrix covered:
- 244 questions per format per model, over 13 datasets
- 6 formats tested head-to-head: TOON, JSON (pretty), JSON compact, YAML, XML and CSV (CSV only answers the 109 flat-data questions)
- 4 models:
claude-haiku-4-5-20251001,gemini-3.6-flash,gpt-5.4-nano,grok-4.5 - 5,856 total LLM calls (244 × 6 × 4)
- Tokenized with the GPT-5
o200k_baseencoding viagpt-tokenizer; reasoning disabled, temperature left at model defaults - Accuracy reported with Wilson 95% confidence intervals
Questions span five types: field retrieval, aggregation, filtering, structure awareness and structural validation. The datasets include uniform employee records, time-series analytics, GitHub repositories, nested e-commerce orders, semi-uniform event logs, deeply nested configuration, five deliberately corrupted validation sets, and two datasets new in the v4 run: feature flags keyed by name and contacts with nested address and plan groups.
v4 note: those two new datasets exercise forms added in TOON spec 4.0. Keyed tables (flags[3:]{enabled,rollout}:) turn an object of uniform objects into a table, and nested field groups (orders[2]{id,customer{name,country},total}:) keep arrays with uniform nested objects tabular. Spec 4.0 also added full-line # comments. Earlier runs had no equivalent data, which is part of why the headline numbers moved.
About the old numbers: an earlier run (early 2026) reported 39.9% fewer tokens and 76.4% vs 75.0% accuracy over 5,016 calls, with different models (Gemini 3 Flash, GPT-5 Nano, Claude Haiku 4.5, Grok 4.1). Those figures are superseded. Every number in this article comes from the current v4.1 run.
The Headline Number: TOON vs JSON Side by Side
Before looking at the tables, it helps to see why token counts diverge. Here is the same three-user array in JSON and then in TOON, as produced by encode() from @toon-format/toon 4.1.1:
{
"users": [
{ "id": 1, "name": "Alice", "role": "admin", "active": true },
{ "id": 2, "name": "Bob", "role": "viewer", "active": true },
{ "id": 3, "name": "Carol", "role": "editor", "active": false }
]
}users[3]{id,name,role,active}:
1,Alice,admin,true
2,Bob,viewer,true
3,Carol,editor,falsePretty-printed with two-space indentation, the JSON is 305 characters; minified it is 171. The TOON version is 94 characters. Every key is written once instead of once per row, and the rows carry no quotes or braces. The header line users[3]{id,name,role,active}: also gives the model an explicit row count and schema to check against, which is why TOON does so well on the structural-validation questions below.
For a deeper look at the structural differences, see What is TOON? and the full JSON vs TOON comparison.
How Much Does TOON Save? Token Reduction by Data Shape
Token savings are not uniform. They depend on how repetitive the data is. The benchmark splits datasets into a flat-only track (fully tabular, CSV-compatible) and a mixed-structure track (nested or semi-uniform). All figures come from the official token-efficiency results using the o200k_base tokenizer.
| Dataset | TOON Tokens | JSON Tokens | vs JSON | vs JSON compact |
|---|---|---|---|---|
| Uniform employee records (flat) | 49,978 | 127,061 | −60.7% | −36.8% |
| Time-series analytics (flat) | 9,115 | 22,245 | −59.0% | −35.9% |
| Top 100 GitHub repos (flat) | 8,937 | 15,337 | −41.7% | −23.2% |
| Flat-only track total | 68,030 | 164,643 | −58.7% | −35.2% |
| Contacts, nested field groups (v4) | 26,726 | 79,779 | −66.5% | −42.9% |
| Feature flags, keyed table (v4) | 10,503 | 23,141 | −54.6% | −32.8% |
| Deeply nested configuration | 589 | 905 | −34.9% | +6.7% |
| E-commerce orders (nested) | 72,832 | 108,611 | −32.9% | +5.6% |
| Semi-uniform event logs | 154,084 | 181,201 | −15.0% | +19.9% |
| Mixed-structure track total | 264,734 | 393,637 | −32.7% | +1.6% |
The pattern is clear: TOON's savings track key repetition. A flat table of employee records repeats the same field names on every row in JSON; TOON declares them once. Against minified JSON the picture is more honest. TOON still saves 35.2% on flat data, but on the mixed track it is 1.6% larger overall, and 19.9% larger on semi-uniform event logs where only half the arrays qualify for tabular form.
On the flat track, CSV is the smallest format of all: TOON is 5.9% larger than CSV (68,030 vs 64,247 tokens), the cost of its array lengths and field headers. Want to see how TOON compares against YAML, CSV and TOML in more depth? See the full format comparison.
Accuracy by Model: Which LLM Reads TOON Best?
Token savings only matter if the model can still answer correctly. All four models answered the same 244 questions in every format. Source: official retrieval-accuracy results.
| Model | TOON Accuracy | JSON Accuracy | Assessment |
|---|---|---|---|
grok-4.5 | 97.1% ±2.2 | 96.3% ±2.5 | Tie, near ceiling |
gemini-3.6-flash | 69.3% ±5.8 | 68.4% ±5.8 | Tie |
claude-haiku-4-5-20251001 | 65.6% ±5.9 | 63.5% ±6.0 | Tie (TOON slightly ahead) |
gpt-5.4-nano | 57.0% ±6.2 | 57.4% ±6.2 | Tie (JSON slightly ahead) |
The spread between models (57% to 97%) is far larger than the spread between formats on any single model (at most 2.1 points between TOON and JSON). TOON is ahead on three of the four models, but on every model the TOON and JSON confidence intervals overlap. The benchmark authors are explicit that when intervals overlap, "the difference between them is not statistically meaningful." The practical reading: switching to TOON does not cost accuracy on any of these models, and choosing a stronger model matters much more than choosing a format. Still, benchmark your own workload before committing at scale.
Accuracy by Question Type: Where TOON Excels and Where It Struggles
Aggregate accuracy hides real variation across task types. Here is TOON next to JSON, averaged over all four models:
| Question Type | TOON | JSON | Example |
|---|---|---|---|
| Structural validation | 100.0% | 50.0% | "Is this dataset complete and valid?" |
| Field retrieval | 97.8% | 99.2% | "What is the value of X?" |
| Structure awareness | 90.3% | 84.0% | "How many records are there?" |
| Aggregation | 48.4% | 48.4% | "What is the average X?" |
| Filtering | 38.0% | 41.1% | "Which records match condition Y?" |
Structural validation is TOON's standout. The datasets include truncated arrays, extra rows, a missing field and missing required values. TOON's declared length and field header (users[3]{...}:) let the model spot the mismatch, while JSON offers nothing to compare against. Treat the 100% vs 50% gap with care, though: the category has only five questions (one per corrupted dataset). Structure awareness benefits from the same mechanism, since the header states the row count directly.
Field retrieval is near-perfect for every format; JSON is marginally ahead. Aggregation and filtering are hard everywhere because they require the model to scan and compute across many rows, and TOON is slightly behind JSON on filtering. For workloads heavy in aggregation or filtering, do the math in code and send the model the result. See how to reduce LLM API costs in production.
The Efficiency Metric: Accuracy per 1,000 Tokens
Raw accuracy alone is misleading if two formats have different token costs. The benchmark computes a composite efficiency score: accuracy percentage per 1,000 tokens consumed (average tokens per question context).
| Format | Overall Accuracy | Avg Tokens | Accuracy % / 1K tokens |
|---|---|---|---|
| TOON | 72.2% ±2.8 | 2,474 | 29.2 |
| JSON compact | 69.0% ±2.9 | 2,892 | 23.8 |
| YAML | 70.1% ±2.9 | 3,487 | 20.1 |
| JSON | 71.4% ±2.8 | 4,308 | 16.6 |
| XML | 70.7% ±2.9 | 4,909 | 14.4 |
TOON matches JSON's accuracy while using 42.6% fewer tokens. At equal budget, that means you can send roughly 74% more data (4,308 ÷ 2,474) without losing accuracy. On the 109 flat-data questions, where CSV can compete, the result is similar: TOON 63.1% at 1,994 tokens, CSV 62.2% at 1,851, and JSON 60.3% at 3,950. For RAG pipelines that retrieve dozens of records per query, efficiency is the number that matters most. See how this plays out in the JSON vs TOON deep-dive.
When TOON Does Not Beat JSON: The "Prompt Tax" and Non-Linear Payoff
No benchmark summary is complete without the caveats. An independent paper, "Token-Oriented Object Notation vs JSON: A Benchmark of Plain and Constrained Decoding Generation" (arXiv 2603.03306, Feb 2026), and the official results themselves point to conditions where JSON wins or ties:
- Generation tasks. When the model must output TOON rather than read it, plain JSON achieves better one-shot and final accuracy. The reason is the "prompt tax": to reliably produce valid TOON, you must include format instructions in the system prompt. Those instructions consume tokens, partially offsetting TOON's savings, and add a failure mode if the model ignores them.
- Small payloads. TOON's savings are non-linear. The header (
fieldName[n]{col1,col2,...}:) has a fixed cost, and on a three-row array the savings are small in absolute terms. If you also need format instructions, they can cost more than you save. As a rule of thumb (ours, not the benchmark's), the payoff becomes clear once you have a few dozen rows of uniform data. - Semi-uniform and deeply nested data. Against minified JSON, TOON is 19.9% larger on semi-uniform event logs and 6.7% larger on deeply nested configuration. If your payload looks like that, compact JSON is often the better choice.
- Multi-turn agent loops. A separate study (arXiv 2605.29676) on agentic tool-use benchmarks with five open-weight models found TOON saved up to 18% of tokens at roughly a 9-point accuracy cost, and concluded it is "not safe as a default in multi-turn agentic systems."
Model choice also matters far more than format: the same TOON input scores 57.0% on gpt-5.4-nano and 97.1% on grok-4.5. Always test the specific model, task type and data shape for your production workload before switching formats at scale. Our guide on when not to use TOON covers these cases in more detail.
What This Means in Production
The benchmark data supports a practical decision framework:
- Use TOON when: injecting large uniform arrays (logs with a fixed schema, time-series, product catalogs, user records), maps of uniform objects (keyed tables) or records with uniform nested objects (nested field groups) into a prompt. Expect 40–67% fewer tokens than pretty JSON with accuracy on par, across all four tested models.
- Use JSON when: the model must generate structured output, the payload is tiny, or the data is semi-uniform or deeply heterogeneous. In those cases minified JSON is often as small or smaller.
- Use CSV when: the data is purely flat and you do not need the length and header guardrails. It is about 6% smaller than TOON on flat tables.
- Test first when: your workload is mostly aggregation or filtering questions, where every format scores below 50%.
To convert your existing JSON to TOON instantly without writing any code, use the free JSON to TOON converter. For a comprehensive look at which format fits which scenario, read the TOON format comparison guide.
Frequently Asked Questions
How many tokens does TOON save vs JSON?
In the current official TOON benchmark (v4.1, 5,856 LLM calls across 4 models), TOON used 42.6% fewer tokens than pretty-printed JSON on average. Savings depend on data shape: the flat-only track saves 58.7%, while the mixed-structure track saves 32.7%. Against minified JSON, TOON saves 35.2% on flat data but is 1.6% larger on mixed data. Source: toonformat.dev/guide/benchmarks.
Is TOON more accurate than JSON for LLMs?
Roughly the same. TOON scored 72.2% (±2.8) overall retrieval accuracy vs JSON's 71.4% (±2.8). The confidence intervals overlap, so the difference is not statistically meaningful. The real advantage is efficiency: TOON delivers 29.2 accuracy points per 1,000 tokens vs JSON's 16.6, about 76% more accuracy per token spent.
Which model reads TOON best?
grok-4.5 scores highest at 97.1% on TOON inputs (96.3% on JSON), followed by gemini-3.6-flash at 69.3% (68.4% JSON), Claude Haiku 4.5 at 65.6% (63.5% JSON) and gpt-5.4-nano at 57.0% (57.4% JSON). On every model, TOON and JSON land within each other's confidence intervals: the model matters far more than the format.
Does TOON ever lose to JSON?
Yes. An independent arXiv study (2603.03306) found that for generation tasks, where the model must output TOON, plain JSON had better one-shot accuracy due to TOON's "prompt tax": the instructional overhead needed to teach the format. In the official benchmark, minified JSON is also smaller than TOON on semi-uniform event logs (by 19.9%) and deeply nested config (by 6.7%), and TOON trails JSON slightly on filtering questions (38.0% vs 41.1%).
What types of questions does TOON answer best?
Field retrieval is TOON's strongest question type at 97.8% (JSON 99.2%), followed by structure awareness at 90.3% (JSON 84.0%). TOON scored 100% on structural validation vs JSON's 50%, thanks to its declared row counts and field headers, though that category has only five questions. Aggregation (48.4%, tied with JSON) and filtering (38.0% vs 41.1%) are hard for every format.
Recommended Reading
TOON vs Minified JSON: When Compact JSON Wins
The latest TOON benchmark shows compact JSON beats TOON on mixed, nested data, while TOON wins big on uniform tables. Here is how to choose for your payload.
Using TOON with Google Gemini
TOON with Google Gemini: Gemini 3.6 Flash read TOON as accurately as JSON in the official benchmark. Feed TOON context to the Gemini API and its large window.
Using TOON with Claude: Token Savings and Prompt Caching
How to pass TOON context to Claude, why to benchmark accuracy on your model first, and how Anthropic's 90% cache-read discount stacks with TOON's token savings.