Token-Oriented Object Notation
| Token-Oriented Object Notation | |
|---|---|
| Filename extension |
.toon |
| Internet media type |
text/toon |
| Type code | TEXT |
| Latest release | 3.0 2025-11-24 |
| Type of format | Data serialization |
| Extended from | JSON |
| Website | toonformat |
Token-Oriented Object Notation (TOON) is a text-based data format. It encodes the JSON data model in a compact way. TOON is designed to reduce token usage in LLM prompts while staying human-readable.[1]
History
[edit]TOON was introduced in 2024 by the TOON Project. The goal was to make structured data smaller for AI systems. Version 1.0 focused on basic JSON conversion. Version 2.0 added array headers. Version 3.0, released in 2025, improved syntax and added official media type.[2]
Features
[edit]TOON was created for three main reasons:
- Reduce token count in AI prompts. TOON saves about 30–60% on tokens compared to JSON.[1]
- Stay easy for humans to read and write. Similar to YAML and CSV in style.[2]
- Keep data lossless when converting to and from JSON.[1]
Syntax
[edit]TOON uses indentation instead of braces for objects. It declares array length and field names once in a header. Arrays of objects are written in a tabular form. Strings are quoted only when needed.[1][2]
users[2]{id,name,role}:
1,Alice,admin
2,Bob,user
This means an array named "users" with two objects having fields "id," "name," and "role."[1][3]
Comparison to JSON
[edit]TOON and JSON both represent objects and arrays. TOON removes braces and commas. It uses headers for arrays instead of repeating keys. This makes TOON shorter but less strict than JSON.[2]
The same TOON-defined data above as JSON:
{
"users": [
{ id: 1, name: "Alice", role: "admin" },
{ id: 2, name: "Bob", role: "user" },
]
}
Other information
[edit]The provisional media type is text/toon. Files use the .toon extension.[1]
Official implementations exist in TypeScript. Community versions are in Python, Go, Rust, and .NET.[2]
See also
[edit]References
[edit]- ^ a b c d e f "TOON Format Specification". GitHub. 2025-11-24.
- ^ a b c d e "TOON Documentation". TOON Project.
- ^ "🚀 TOON (Token-Oriented Object Notation) — The Smarter, Lighter JSON for LLMs". DEV Community. November 2, 2025. Retrieved 2025-12-16.