TOON Token Calculator

Paste JSON to see how many tokens TOON and TONL would save, and what that means per million LLM calls.

FormatTokensvs pretty JSONCost / 1M calls
JSON (pretty, 2 spaces)1010%$101
JSON (minified)6140%$61
TOON3664%$36
TONL4357%$43

Positive % = fewer tokens than pretty-printed JSON. Cost assumes this payload is sent as input once per call. Everything runs in your browser.

Which tokenizer is used?

None: this is an estimate of 1 token per 4 characters, the same rule the JSON to TOON converter uses. Real tokenizers (o200k_base for GPT, Claude's, Gemini's) give different absolute numbers, and punctuation-heavy JSON usually costs a bit more than the estimate. Use the percentages as a guide and check exact counts with your provider's tokenizer. The tokenizer comparison shows how savings vary by model.

What savings to expect

TOON uses about 43% fewer tokens than JSON on average (42.6% in the official TOON v4.1 benchmark). Arrays of objects with the same keys save the most; deeply nested or irregular data saves much less, and can occasionally be larger. That is why it is worth measuring your own payload here before you switch.

About the price field

Prices change often, so the calculator does not ship vendor prices. The default of $1.00 is a placeholder: enter your model's current input price per 1M tokens from your provider's pricing page.

Next steps

Convert the data in the online converter, automate it with the TOON API, or convert selected text on any page with the TOON Chrome extension. New to the format? Read the TOON guide.

FAQ

How does the calculator count tokens?

It estimates tokens as characters divided by 4, the same estimate the json2toon converter uses. It is not a real tokenizer, so exact counts for GPT, Claude or Gemini will differ, but the ratio between JSON and TOON is a good guide.

Why compare against pretty-printed JSON?

Most JSON pasted into prompts is pretty-printed. Minified JSON is shown too, so you can see the smaller gap against it.

How is cost per 1M calls calculated?

Tokens multiplied by the input price you enter (USD per 1M tokens). That equals the cost of sending this payload as input one million times. Output tokens and the rest of your prompt are not included.

Is my JSON uploaded?

No. Parsing, encoding and counting all happen in your browser.