Karvics
AboutToolsProjectsBlogContact
Back to Tools

TOON vs JSON Token Benchmark

TOON (Token-Oriented Object Notation) is commonly claimed to cut LLM token usage by 30-50%. Karvics ran that claim against real payloads using the same open-source tokenizer and TOON encoder this site ships in its own tools — including a case where TOON loses. Last run: 2026-07-22.

Results

Payloadcl100k_base (GPT-4)o200k_base (GPT-4o)Claude (approx.)
User records
Uniform array of 30 user objects — TOON's best case.
1176 → 791 tokens (-32.7%)1170 → 785 tokens (-32.9%)1176 → 791 tokens (-32.7%)
API log entries
Uniform array of 40 log lines — a common tabular payload shape.
1512 → 1202 tokens (-20.5%)1552 → 1202 tokens (-22.6%)1512 → 1202 tokens (-20.5%)
Nested service config
Deeply nested, non-uniform object with no repeated array shape — a losing case for TOON.
173 → 212 tokens (+22.5%)174 → 211 tokens (+21.3%)173 → 212 tokens (+22.5%)

Negative percentages (red) mean TOON used more tokens than JSON for that payload.

Methodology

Each input file is parsed as JSON, then encoded with @toon-format/toon's encode(). Both the compact JSON.stringify() output and the TOON output are tokenized with js-tiktoken's cl100k_base and o200k_base encoders. The "claude_approx_cl100k" column reuses the cl100k_base count as an approximation — there is no official offline Claude tokenizer in this toolchain, and Claude's real tokenizer is not publicly distributable, matching the same disclaimer already shown in the Token Count & Cost Estimator tool.

  • js-tiktoken version 1.0.21
  • @toon-format/toon version 2.3.1

Input Files

The exact JSON payloads used to generate the numbers above, so the results can be independently reproduced:

  • users.json — 3692 JSON chars, 2024 TOON chars
  • api-logs.json — 5274 JSON chars, 2962 TOON chars
  • nested-config.json — 642 JSON chars, 712 TOON chars

Honest Take

TOON's savings come specifically from uniform arrays of same-shaped objects — rows from a database or API list, where CSV-style formatting removes repeated key names. On deeply nested, non-uniform data with no repeated array shape, TOON adds structural overhead and can use more tokens than plain JSON, as the nested config payload above shows. Use the JSON to TOON converter to check your own payload shape before committing to it in a production prompt.

Karvics

Free online tools for developers, designers, and digital professionals. All tools work offline in your browser with no signup required.

Tool Categories

  • PDF Tools
  • Image Tools
  • Cryptography Tools
  • Password Tools
  • URL Tools
  • Notepad Tools
  • SEO Tools
  • TOON Tools
  • Dev Tools

Quick Links

  • All Tools
  • About Us
  • Projects
  • Blog
  • TOON Benchmark
  • Privacy Policy
  • Terms of Use
  • Contact Us
  • Sitemap
  • For AI Agents
  • Report an Issue

© 2026 Karvics. All rights reserved.