JSON to TOON Converter
Token-Oriented Object Notation — shrink uniform JSON arrays before they hit your prompt.
events[12]{user_id,event_type,page_id,session_id,duration_ms,converted}: 8841,click,102,5501,1240,false 8842,view,87,5502,320,false 8843,signup,12,5503,4870,true 8844,click,102,5504,980,false 8845,purchase,44,5505,15300,true 8846,view,87,5506,210,false 8847,click,19,5507,1670,false 8848,signup,12,5508,5210,true 8849,view,203,5509,540,false 8850,purchase,44,5510,12900,true 8851,click,102,5511,760,false 8852,view,87,5512,430,false
Switching structured data from JSON to TOON can cut its token count by 30–60% — often more for big, uniform lists. The converter above shows the token (and dollar) savings in real time as you paste.
If you pass structured data to an LLM as JSON, you're paying for a lot of repetition. JSON repeats every key on every object and spends tokens on braces, brackets, commas, and quotes — overhead that scales with the size of your data and counts against both your bill and your context window. TOON (Token-Oriented Object Notation) represents the same data more compactly: arrays of uniform objects collapse into a single header row that names the fields once, followed by one line of values per record, with most punctuation removed.
It's most useful when you embed lists of records — users, products, rows, search results, events — inside a prompt: that's where the per-key repetition of JSON is most wasteful and where TOON's tabular form wins biggest. Everything runs in your browser, so your data never leaves your device. Token estimates are approximate; confirm exact counts with your model's tokenizer before relying on a number for budgeting.
How to use this converter
- Paste your JSON into the left box. It can be pretty-printed or minified.
- Read the TOON on the right — it updates as you type. If your JSON is invalid, you'll see a parse error instead.
- Pick a delimiter. Comma is the default; switch to tab for the fewest tokens (watch the estimate change) or pipe for a readable middle ground.
- Check the savings. The stat cards compare estimated tokens and characters against compact JSON.
- Copy the TOON and paste it into your prompt.
Tell the model what it's looking at — a one-line note like "the data is in TOON: a header lists the fields, each following row is one record" is usually enough for reliable parsing.
When TOON saves the most
The savings come entirely from structure, so it's worth knowing where to reach for it:
- Big wins: arrays of many uniform objects — database rows, API result lists, catalogs, event logs. Keys are written once instead of on every element.
- Modest wins: mixed objects with some repeated structure and some nesting.
- Little or none: a single small object, or deeply nested, irregular data with no tabular shape to exploit. In those cases compact JSON may be just as good.
Reducing tokens is one lever on your bill; choosing the right model and using caching are the others. See the AI API cost calculator to price your workload, and the pricing comparisons for the bigger picture on cutting AI API costs.