Token-Oriented Object Notation (TOON) format expert for 30-60% token savings on structured data. Auto-applies to arrays with 5+ items, tables, logs, API responses, database results. Supports tabular, inline, and expanded formats with comma/tab/pipe delimiters. Triggers on large JSON, data optimization, token reduction, structured data, arrays, tables, logs, metrics, TOON.
TOON (Token-Oriented Object Notation) saves 30-60% tokens on structured data by eliminating repetitive keys in uniform arrays.
Automatically apply TOON when:
Keep as JSON when:
For arrays of uniform objects:
[count]{field1,field2,field3}:
value1,value2,value3
value1,value2,value3
Example - JSON (120 tokens):
[
{"id": 1, "name": "Alice", "role": "admin", "active": true},
{"id": 2, "name": "Bob", "role": "user", "active": true},
{"id": 3, "name": "Carol", "role": "user", "active": false}
]
TOON (70 tokens, 42% savings):
[3]{id,name,role,active}:
1,Alice,admin,true
2,Bob,user,true
3,Carol,user,false
For primitive arrays (10 or fewer items):
fieldName[count]: value1,value2,value3
Example:
tags[4]: javascript,react,nodejs,api
ids[3]: 101,102,103
For complex nested values (one per line):
items[3]|:
| {"complex": "object1"}
| {"complex": "object2"}
| {"complex": "object3"}
Choose based on data content:
| Delimiter | Syntax | Use When |
|---|---|---|
| Comma | [N] | Default, no commas in values |
| Tab | [N\t] | Values contain commas |
| Pipe | [N|] | Values contain commas and tabs |
Tab-delimited example:
[2\t]{name,description}:
Product A A great product, really
Product B Another one, even better
Flatten nested structures:
server.host: localhost
server.port: 8080
server.ssl.enabled: true
database.url: postgres://localhost/db
| Value | TOON Representation |
|---|---|
| null | ~ |
| empty string | "" |
| true | true |
| false | false |
Before (JSON):
{
"users": [
{"id": 1, "email": "[email protected]", "plan": "pro"},
{"id": 2, "email": "[email protected]", "plan": "free"},
{"id": 3, "email": "[email protected]", "plan": "pro"}
],
"total": 3
}
After (TOON):
users[3]{id,email,plan}:
1,[email protected],pro
2,[email protected],free
3,[email protected],pro