JSON to TOON Converter

JSON TOON converter

Token-Oriented Object Notation — shrink uniform JSON arrays before they hit your prompt.

Lossless · reversible
At calls/day on you'd save about $1,889 per year on input tokens — estimate at $2.50 / 1M input tokens
JSON in 1,284 chars · 321 tokens
TOON out 456 chars · 114 tokens
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
JSON 1,284 charsvsTOON 456 chars64% smaller
Token counts are estimates (~4 chars/token) compared against compact JSON — confirm exact counts with your model's tokenizer. TOON wins biggest on arrays of uniform objects; deeply nested or irregular data saves less. Dollar figures use list input-token rates as of June 2026.

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

  1. Paste your JSON into the left box. It can be pretty-printed or minified.
  2. Read the TOON on the right — it updates as you type. If your JSON is invalid, you'll see a parse error instead.
  3. 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.
  4. Check the savings. The stat cards compare estimated tokens and characters against compact JSON.
  5. 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.

JSON to TOON — FAQ

What is TOON?
TOON (Token-Oriented Object Notation) is a compact, indentation-based data format designed to represent the same data as JSON using fewer tokens when sent to a large language model. Its headline trick is collapsing arrays of uniform objects into a tabular header plus rows, instead of repeating every key on every element.
Why convert JSON to TOON?
Tokens cost money and fill your context window. JSON repeats every key for every object and spends tokens on braces, brackets, and quotes. TOON declares each key once for a table of objects and drops most punctuation, so the same data costs noticeably fewer input tokens — which lowers cost and leaves more room in the context window.
How much can TOON save?
It depends entirely on the shape of your data. Arrays of many uniform objects (records, rows, lists of entities) save the most — often 30–60% of tokens — because the keys are written once instead of per item. Deeply nested or highly irregular data saves little, and a single small object may save nothing.
Are the token counts exact?
No — the savings shown are estimated at roughly four characters per token and compared against compact JSON. Different models use different tokenizers, so your real numbers will vary. Use the estimate to compare shapes and confirm exact counts with your model's tokenizer before relying on them.
Does my data get uploaded anywhere?
No. The conversion runs entirely in your browser with JavaScript — your JSON is never sent to a server. You can paste sensitive data and it stays on your device.
Can the model actually read TOON?
Yes. Modern LLMs handle TOON well because it's regular and human-readable, and it's often easier to parse than minified JSON. For best results, briefly tell the model the format in your prompt (e.g. 'the data below is in TOON, a tabular format where a header lists fields and each following row is one record').
When should I NOT use TOON?
When the receiving system expects strict JSON, when your data is mostly deeply nested or non-uniform (little tabular structure to exploit), or when you need a guaranteed round-trip back to JSON through tooling that doesn't support TOON. For API request/response bodies themselves, stick with JSON; TOON is for the data you embed inside a prompt.
Which delimiter should I choose?
Comma is the safe default and most readable. Tab usually produces the fewest tokens because a tab is a single token in most tokenizers and never needs quoting, but it's invisible and easy to mangle when copy-pasting. Pipe is a readable middle ground. Try each and watch the token estimate.
Is this converter free?
Yes, completely free, no sign-up, and it runs client-side.