TOON (Token-Oriented Object Notation) is a revolutionary data format designed specifically to optimize data for Large Language Models (LLMs) and reduce API costs. It achieves this by minimizing token usage by 30-60% compared to standard JSON while maintaining human readability.
{
"users": [
{
"id": 1,
"name": "Alice",
"role": "admin"
},
{
"id": 2,
"name": "Bob",
"role": "user"
}
]
}Token count: ~45 tokens
users[2]{id,name,role}:
1,Alice,admin
2,Bob,userToken count: ~18 tokens (60% reduction!)
Uniform arrays are represented in a compact tabular format with explicit field headers, eliminating redundant key repetition.
Array lengths are explicitly declared, providing clear schemas that enhance parsing reliability in LLMs.
Similar to YAML, TOON uses indentation to represent hierarchy, making it both compact and readable.
Removes redundant brackets, braces, and repeated keys, significantly reducing token count.
Reduce API costs by sending more data with fewer tokens to language models.
Optimize API payloads to reduce bandwidth and processing costs.
Store structured data more efficiently while maintaining readability.
Use TOON for configuration files that need to be both compact and human-readable.