Discover TOON (Token-Oriented Object Notation), the data format specifically engineered for the LLM era. Optimize your AI interactions with token-efficient serialization.
TOON (Token-Oriented Object Notation) is a compact, text-based data serialization format specifically engineered for Large Language Models (LLMs). Unlike traditional formats like JSON or XML, which were designed for machine-to-machine communication, TOON is optimized to minimize "Token" consumption. It strips away redundant syntax (like repeated keys and excessive punctuation) to make data more "digestible" for AI models.
The primary purpose of TOON is to optimize the interaction between humans (or systems) and LLMs. Its main use cases include:
By reducing the number of tokens required to represent data, it directly lowers the cost of using LLM APIs (like GPT-4 or Claude).
It allows you to fit significantly more information (up to 2-3x more data) into the same limited context window.
The structured, table-like layout helps models better understand relationships between data points, improving accuracy in data extraction and analysis tasks.
TOON provides unique capabilities tailored for AI model performance.
Eliminates repetitive keys in arrays and unnecessary quotes/braces.
Uses indentation and headers that align with how LLMs "attend" to text.
Defines the structure (keys) once at the top of a list rather than repeating them for every object.
Includes explicit array lengths (e.g., items[5]), which helps the model verify data integrity and prevents "hallucinations" of extra items.
TOON blends the simplicity of YAML with the structure of a CSV file.
Use indentation and a colon (similar to YAML).
Defined with a length and a header in curly braces.
Quotes are optional for simple strings. No commas are needed at the end of lines.
user:
id: 101
name: Alice
tags: [3]{id, label}:
1, developer
2, tech-lead
3, remoteComparing TOON with the industry standard JSON format.
| Feature | JSON | TOON |
|---|---|---|
| Token Usage | High (High overhead due to brackets/quotes) | Low (Optimized for density) |
| Redundancy | Keys are repeated for every object in a list | Keys are declared once per list |
| Readability | Standard for developers | Highly readable for LLMs and humans |
| Data Integrity | Implicit | Explicit (uses counts like [n]) |
| Primary Goal | General data exchange | LLM efficiency |
When to choose TOON over other formats.