Skip to content
json2toon.co
ConvertDocsAPIBlog
Open source
ConvertDocsAPIBlogGitHub
Home/Format comparison/TOON vs JSON

TOON vs JSON: token counts, accuracy and when to use each

Updated 2026-11-17 by json2toon.co

TOON holds the same data as JSON in fewer tokens: about 43% fewer on average in the official TOON v4.1 benchmark (42.6%), with retrieval accuracy statistically tied with JSON. The saving comes from arrays of similar objects. Keep JSON for APIs, storage, model output and small or deeply nested payloads, and use TOON for the data you put into a prompt.

Convert JSON to TOON →Measure your own JSON →

Token counts on the same data

Sample dataJSONJSON (minified)TOON
GitHub issues: Flat uniform array: 8 records, 7 fields each587388 (-34%)294 (-50%)
Stripe charges list: Object wrapping a uniform array: 7 records, 7 fields each512335 (-35%)246 (-52%)
Nested orders: 3 records, each with a nested customer object and an items array219122 (-44%)146 (-33%)
Kubernetes Deployment: Deeply nested config, no uniform arrays230119 (-48%)132 (-43%)
Tokens counted with o200k_base (GPT-4o and GPT-5 family); percentages are relative to JSON. Every output was produced by this site's converter (@toon-format/toon 4.4.0, tonl 2.5.2). These are small samples taken from the converter's built-in examples and conversion pages, not a benchmark: measure your own payload in the TOON token calculator.

What is the difference between TOON and JSON?

Both formats describe the same data model: objects, arrays, strings, numbers, booleans and null. JSON writes every key, quote and brace for every object. TOON (Token-Oriented Object Notation) writes an array of similar objects as one header that names the fields and declares the row count, followed by one line of values per record.

GitHub issues as JSON: 587 tokens, 1,639 characters
[
  {
    "number": 1342,
    "title": "Crash when input contains a BOM",
    "state": "open",
    "user": "mkowalski",
    "comments": 4,
    "labels": "bug",
    "created_at": "2026-09-28T09:12:44Z"
  },
  {
    "number": 1341,
    "title": "Support tab delimiter in CLI",
    "state": "open",
    "user": "ana-r",
    "comments": 2,
    "labels": "enhancement",
    "created_at": "2026-09-27T16:03:10Z"
  },
  {
    "number": 1339,
    "title": "Docs: clarify nested array output",
    "state": "closed",
    "user": "tlee",
    "comments": 1,
    "labels": "docs",
    "created_at": "2026-09-25T11:47:02Z"
  },
  {
    "number": 1337,
    "title": "Wrong length marker on empty arrays",
    "state": "closed",
    "user": "jdoe",
    "comments": 7,
    "labels": "bug",
    "created_at": "2026-09-22T08:30:19Z"
  },
  {
    "number": 1335,
    "title": "Add Python bindings",
    "state": "open",
    "user": "pnguyen",
    "comments": 12,
    "labels": "enhancement",
    "created_at": "2026-09-20T19:55:41Z"
  },
  {
    "number": 1332,
    "title": "Benchmark against minified JSON",
    "state": "open",
    "user": "sofia-m",
    "comments": 3,
    "labels": "question",
    "created_at": "2026-09-18T13:21:08Z"
  },
  {
    "number": 1330,
    "title": "Unicode keys are double-quoted",
    "state": "closed",
    "user": "kwame",
    "comments": 2,
    "labels": "bug",
    "created_at": "2026-09-15T07:09:33Z"
  },
  {
    "number": 1328,
    "title": "Streaming decoder for large files",
    "state": "open",
    "user": "lhansen",
    "comments": 9,
    "labels": "enhancement",
    "created_at": "2026-09-12T22:40:57Z"
  }
]
GitHub issues as TOON: 294 tokens, 727 characters
[8]{number,title,state,user,comments,labels,created_at}:
  1342,Crash when input contains a BOM,open,mkowalski,4,bug,"2026-09-28T09:12:44Z"
  1341,Support tab delimiter in CLI,open,ana-r,2,enhancement,"2026-09-27T16:03:10Z"
  1339,"Docs: clarify nested array output",closed,tlee,1,docs,"2026-09-25T11:47:02Z"
  1337,Wrong length marker on empty arrays,closed,jdoe,7,bug,"2026-09-22T08:30:19Z"
  1335,Add Python bindings,open,pnguyen,12,enhancement,"2026-09-20T19:55:41Z"
  1332,Benchmark against minified JSON,open,sofia-m,3,question,"2026-09-18T13:21:08Z"
  1330,Unicode keys are double-quoted,closed,kwame,2,bug,"2026-09-15T07:09:33Z"
  1328,Streaming decoder for large files,open,lhansen,9,enhancement,"2026-09-12T22:40:57Z"

Conversion is lossless in both directions: TOON decodes to exactly the JSON it was encoded from, with the same values, types and key order. That is why you can add TOON at one point in a pipeline without touching the rest of it.

How many tokens does TOON save compared with JSON?

TOON uses about 43% fewer tokens than JSON on average (42.6% in the official TOON v4.1 benchmark, 5,856 LLM calls across four models). On the samples above, measured with this site's tokenizer, the flat GitHub issues array drops from 587 tokens as pretty-printed JSON to 294 as TOON (50% fewer), and the Stripe charges list from 512 to 246 (52% fewer).

The baseline matters. Against minified JSON the same two samples save 24% and 27%. On the nested orders sample and the Kubernetes manifest, which have no uniform arrays to collapse, minified JSON is smaller than TOON (122 vs 146 tokens and 119 vs 132). The official token-efficiency results show the same pattern at scale, which we walk through in TOON vs minified JSON.

Do models read TOON as accurately as JSON?

For reading data, yes. The official benchmark asked four models 244 questions per format (5,856 calls in total) and scored TOON at 72.2% against JSON at 71.4%. The published results note that the confidence intervals overlap, so treat that as a tie rather than a win. Our benchmark write-up breaks the numbers down by model and data shape.

For writing data, JSON is still the safer choice. An independent arXiv study (2603.03306) found plain JSON had the best accuracy when models had to generate structured output, and that the instructions needed to teach TOON eat into its savings on short prompts. In tool-calling agents, "Notation Matters" (arXiv 2605.29676) measured up to 18% fewer tokens for TOON at about a 9 point accuracy cost on open-weight models. See is TOON safe for AI agents for the details.

When should you use TOON, and when should you keep JSON?

Use TOON whenKeep JSON when
You send lists of similar records to a model: query results, API responses, logs, RAG chunksThe data goes to an API, a database or other code
The model only has to read the dataThe model has to write the data (structured outputs, tool calls)
Payloads are large enough for the header to pay for itselfPayloads are small or deeply nested with no repeated shape
You were sending pretty-printed JSONYou already send minified JSON and the data is not tabular

The usual pattern is to keep JSON everywhere and encode to TOON at the last step before the prompt. The JSON to TOON migration guide covers that step by step, and when not to use TOON lists the cases where it costs more than it saves.

Try it on your data

Everything runs in your browser, so nothing you paste is uploaded. Convert a real payload, then check the token counts side by side before you decide.

Convert JSON to TOON →Measure your own JSON →

Frequently asked questions

Is TOON better than JSON?

For data a model reads, usually: TOON uses about 43% fewer tokens than JSON on average (42.6% in the official TOON v4.1 benchmark) at statistically equal retrieval accuracy. For APIs, storage and model output, JSON is still the better choice because every tool and model handles it natively.

Is converting JSON to TOON lossless?

Yes. TOON encodes the JSON data model, so decoding TOON returns the same values, types and key order as the original JSON.

Is TOON smaller than minified JSON?

Only on tabular data. In our samples TOON used 24% fewer tokens than minified JSON on a flat array of 8 records, but minified JSON was smaller on a nested orders sample (122 vs 146 tokens).

Should an LLM output TOON or JSON?

JSON. An independent arXiv study (2603.03306) found plain JSON had the best accuracy for generated structured output. Use TOON for input data and JSON, ideally with structured outputs, for what the model writes.

Does TOON replace JSON in my application?

No. Keep JSON in your APIs, database and code, and encode to TOON only where data enters a prompt. Because the conversion is lossless you can decode back to JSON at any point.

Keep reading

  • How LLM tokenization works
  • TOON vs minified JSON: when compact JSON wins
  • TOON benchmarks 2026: savings and accuracy by model
  • TOON format guide and syntax

More comparisons

  • TOON vs JSON vs YAML: all formats compared
  • TOON vs TONL
  • TOON vs YAML
  • TOON vs CSV
  • TOON alternatives
  • JSON to TOON migration
Privacy-first web converter. Browser-based conversions keep source data on your device.

Product

  • JSON Tools
  • Convert
  • Token Calculator
  • TOON API
  • MCP Server
  • Chrome Extension

Resources

  • TOON vs JSON, YAML, CSV
  • TOON Alternatives
  • FAQ
  • Use Cases
  • TOON Libraries
  • Changelog
  • LLMs.txt

Project

  • About
  • Contact
  • Privacy
  • Terms
  • GitHub
  • Report Bug

© 2026 json2toon.co

Listed on dofollow.tools