TOON, the new JSON Alternative
dev.to·12w·
Discuss: DEV

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...

Keyboard Shortcuts

Navigation
Next / previous item
j/k
Open post
oorEnter
Preview post
v
Post Actions
Love post
a
Like post
l
Dislike post
d
Undo reaction
u
Recommendations
Add interest / feed
Enter
Not interested
x
Go to
Home
gh
Interests
gi
Feeds
gf
Likes
gl
History
gy
Changelog
gc
Settings
gs
Browse
gb
Search
/
General
Show this help
?
Submit feedback
!
Close modal / unfocus
Esc

Press ? anytime to show this help