Toon
Free🎒 Token-Oriented Object Notation (TOON) – Compact, human-readable, schema-aware JSON for LLM prompts. Spec, benchmarks, TypeScript SDK.
About Toon
TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of the JSON data model designed specifically for LLM prompts. It achieves up to ~40% fewer tokens compared to JSON while maintaining or improving accuracy (76.4% vs 75.0% in benchmarks). TOON uses indentation instead of braces, minimizes quoting, and introduces explicit schema guardrails via [N] lengths and {fields} headers to improve parsing reliability. Uniform arrays of objects can be represented as tables that declare fields once and stream row values line by line. The spec-driven ecosystem includes TypeScript, Python, Go, Rust, and .NET SDKs, along with a CLI and playground for experimentation.
Key Features
Pros & Cons
- Reduces token usage by ~40% compared to JSON in mixed-structure benchmarks
- Achieves 76.4% accuracy (vs JSON's 75.0%) in prompt benchmarks across 4 models
- Human-readable format with explicit schema guidance for models
- Deterministic, lossless encoding of JSON data model
- Open-source ecosystem with multiple language SDKs (MIT license)
- Smaller ecosystem and community adoption compared to JSON
- Requires specific parser support (not natively supported by general-purpose tools)