TOON, the new JSON Alternative
dev.to·14h·
Discuss: DEV
Flag this post

Everybody is talking about TOON today, and how it could reduce token consumption in AI agents. On average, TOON saves you somewhere between 30 and 50 percent, with the tradeoff being it’s much less humanly readable. In some ways it’s the “machine code equivalent” of JSON.

The whole point with TOON is to preserve LLM tokens in AI agents. Below is an example.

users[2]{id,name,role}:
1,Alice,admin
2,Bob,user

The above is the equivalent to the following JSON.

{
"users": [
{
"id": 1,
"name": "Alice",
"role": "admin"
},
{
"id": 2,
"name": "Bob",
"role": "user"
}
]
}

If you don’t understand the syntax, then realise it first mentions the field name of objects and collections, for then to just provide a “CSV lookalike” list of values. It took me about 5 seconds t…

Similar Posts

Loading similar posts...