JSON to TOON converter
Convert JSON into TOON (Token-Oriented Object Notation), a compact format for sending data to AI models, and see roughly how many tokens it saves.
Covers any country Runs in your browser
What TOON is
TOON (Token-Oriented Object Notation) is a compact way of writing the same data as JSON, designed for prompts sent to large language models. Models are billed per token, and JSON spends many tokens on braces, quotes and repeated keys. TOON uses indentation instead of braces, drops most quotes, and writes arrays of similar objects as a small table with the keys declared once.
Example
This JSON:
{"users":[{"id":1,"name":"Alice","role":"admin"},{"id":2,"name":"Bob","role":"editor"}],"settings":{"theme":"dark","tags":["new","beta"]}}
becomes this TOON:
users[2]{id,name,role}:
1,Alice,admin
2,Bob,editor
settings:
theme: dark
tags[2]: new,beta
The [2] says how many items follow and {id,name,role} names the fields once, so the model can check it received everything. Savings are largest for lists of similar records, where TOON often uses 30% to 60% fewer tokens; for small or deeply nested objects the gain is small.
The rules in brief
- Objects: one
key: valueper line, nested objects indented underneath. - Arrays of simple values:
tags[3]: a,b,con one line. - Arrays of objects with the same keys: a header row with the field names, then one row per item.
- Mixed arrays: a list with
-before each item. - Strings only get quotes when they need them, for example if they contain a comma, a colon or leading spaces.
About the token estimate
The counts on this page are an estimate based on characters and words, not a real tokenizer, so treat the saving as approximate. Different models tokenize differently. Your data stays in your browser; nothing is uploaded.
Spotted a figure that's wrong or out of date? Tell us and we'll check it against the source.