Reduce token costs when sending structured data to GPT or Claude APIs by using TOON instead of JSON.
Fit more data into an LLM's context window by compressing prompts with schema-aware encoding.
Build chatbot or AI agent systems that need to pass structured configuration or records to language models efficiently.
TOON (Token-Oriented Object Notation) is a compact, human-readable data format designed as an alternative to JSON, specifically optimized for use in prompts sent to large language models (LLMs) like GPT or Claude. The core problem it addresses is that JSON, while widely used, is verbose, it uses a lot of repeated characters like braces, quotes, and colons that waste tokens. In LLM APIs, you pay per token and models have limited context windows, so a more compact format means lower cost and more data fitting in the same space. TOON is schema-aware, meaning it knows the structure of your data upfront and can omit redundant labels, producing shorter output that still carries the same information. The project includes a specification defining the format and a TypeScript SDK for working with it in code. Benchmarks are included to demonstrate how much more compact TOON is compared to standard JSON. You would use TOON when building applications that feed structured data into LLM prompts and want to reduce token usage without sacrificing readability or structure. It is written in TypeScript.
Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.