JSON TOON Converter

Convert JSON to TOON and back — losslessly — and see exactly how many LLM tokens and how much € per call you save. 100% client-side.

Last updated: June 2026
JSON → TOON
Input (JSON)
Waiting for input…
Output (TOON)
No output yet
JSON tokens
TOON tokens
Saved
JSON cost / call
TOON cost / call
You save / call

Paste JSON, or load the sample, to see token and cost savings.

Token counts are exact (OpenAI) or labelled estimates (Claude/Gemini). Cost is an estimate — tokens × the editable price above. Default prices verified Jun 2026; re-check at OpenAI · Anthropic · Google and edit the price to match your rate.

What is TOON?

TOON — Token-Oriented Object Notation — is a compact, lossless way to represent the same data as JSON while using far fewer tokens when sent to a large language model. Instead of repeating every key on every record and wrapping everything in braces, brackets, and quotes, TOON encodes a uniform array of objects as a single header row followed by plain value rows. The result reads a lot like CSV with structure, and it round-trips back to identical JSON.

Why fewer tokens matters

Every token you send to an LLM costs money and consumes context-window budget. Structured data — API responses, database rows, config — is usually the most token-heavy part of a prompt because of all the repeated keys and punctuation. Converting that data to TOON before it hits the model can cut its token cost dramatically, which is why this tool shows you the exact saving and the € difference per call for the model you pick.

Exact vs estimated token counts

For OpenAI models the counts here are exact: GPT-4o and the o-series use the o200k_base tokenizer, and GPT-4 / GPT-3.5 use cl100k_base, both run locally with js-tiktoken. For Claude and Gemini there is no public tokenizer for the current models, and an exact count would require an API call — which would break the privacy guarantee — so those numbers are a calibrated estimate, always marked with a visible tag. We will never present an estimate as exact.

When NOT to use TOON

TOON shines on uniform arrays of objects. For deeply nested, highly irregular, or single-object data with few repeated keys, the TOON form can be the same size or even larger than minified JSON. Being honest about this is the point — the stats bar tells you plainly when JSON would be the smaller choice for your specific input.

Frequently Asked Questions

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, lossless serialization format that represents the same data as JSON using fewer LLM tokens. It is especially efficient for uniform arrays of objects, which it encodes as one header row plus comma- or tab-separated value rows, eliminating repeated keys and most punctuation.

How much does TOON save compared to JSON?

It depends on your data. For uniform arrays of objects (tables), TOON commonly cuts token count by 40–60%. For deeply nested or non-uniform data the saving shrinks, and JSON can occasionally be smaller. This tool measures the real difference for your exact input so you never have to guess.

Is my data private?

Yes. All conversion and token counting happens in your browser using libraries vendored locally under /vendor/. No data is ever sent to a server, no API keys are needed, and there are no runtime network calls — safe for proprietary payloads and sensitive prompts.

When should I NOT use TOON?

TOON wins on uniform, tabular data. For deeply nested structures, highly irregular objects, or data with few repeated keys, the TOON representation can be the same size or larger than minified JSON. The stats bar tells you plainly when JSON would be smaller.

Are the token counts exact?

For OpenAI models the counts are exact, computed locally with js-tiktoken (o200k_base for GPT-4o / o-series, cl100k_base for GPT-4 / GPT-3.5). For Claude and Gemini the exact tokenizers are not public and an exact count would require a forbidden API call, so we show a clearly-labelled calibrated estimate (≈) instead.

How current are the prices, and can I change them?

The per-million-token prices are editable defaults, not a fixed source of truth. The price field is fully editable, your value is saved in your browser for each model, and the tool links to each provider's official pricing page so you can verify the current rate. The token counts are the exact, authoritative part; the cost is simply tokens × the price you set, shown as an estimate — so the figure is always as current as the number you enter.