My Tool Studio
Developer Tools·4 min read

What Is TOON Format? JSON to TOON for LLM Prompts

Token-Oriented Object Notation, TOON for short, is a young serialization format built for one purpose: sending structured data to language models in fewer tokens. The trick is simple. Uniform arrays of objects stop repeating their keys on every record and become compact tables instead. The data is identical and converts back to JSON exactly, and on table-shaped payloads the token count drops noticeably. This article covers how the encoding works, a real before and after, how to read the converter's estimates, and the cases where plain JSON is still the right call.

.json.toonJSON → TOON

What is TOON format, exactly

A new format, honestly labeled.

TOON is an indentation-based serialization format: plain values are written as key: value lines, nesting is expressed with two-space indents instead of braces, and strings are only quoted when they'd otherwise be ambiguous. Arrays declare their length up front, so a list of three tags becomes tags[3]: a,b,c on a single line.

It's worth being straight about its status. TOON is young, defined by a community spec on GitHub rather than by a standards body, and it hasn't earned the two decades of tooling JSON has. That makes it a good fit for prompt payloads you control on both ends, and the wrong pick for public interfaces. Nothing about trying it locks you in, since conversion back to JSON is exact.

How TOON cuts token costs

Stop paying for repeated keys.

Tokenizers charge for everything: braces, brackets, quotes, colons, and every repetition of every key. In a JSON array of 100 objects, each field name appears 100 times, wrapped in quotes each time. That overhead is pure cost, since the model learns nothing new from the 99th repetition of "price".

TOON's answer is tabular encoding. When every object in an array shares the same keys and holds only primitive values, the whole array collapses to a header line naming the fields once, followed by one delimited row per record. That single change is where most of the savings live. On the sample built into the JSON to TOON Converter, four products with five fields each, TOON comes out about a third smaller in estimated tokens than minified JSON.

A worked example: two users, one header row

Input and output, side by side.

Start with this JSON: {"users":[{"id":1,"name":"Alice"},{"id":2,"name":"Bob"}]}. Paste it into the JSON pane and press Convert to TOON. The output is three short lines: users[2]{id,name}: as the header, then 1,Alice and 2,Bob indented beneath it. The braces, brackets, and all four quoted key repetitions are gone, while the declared count and field list preserve the structure.

Even on this toy sample the panels report a real drop, from 26 estimated tokens for minified JSON to 16 for TOON, and the gap widens with every row added, because each new record costs only its values plus a newline. To prove nothing was lost, press Swap direction, which moves the TOON into the input, then press Convert to JSON to rebuild the original. You can also press Upload .json to load a file and Download .toon to save the result.

Reading the token estimate and cost calculator

Useful for comparison, not for billing.

The token counts come from a heuristic that approximates GPT-style tokenizers, not from a real tokenizer, so exact numbers differ between models. Both formats are measured the same way, which keeps the comparison fair. When you need exact counts, use your provider's tokenizer or token counting API.

Below the panels, the cost calculator multiplies the token difference by the number of requests and the input price per million tokens you enter. No prices are built in, so type your model's current rate. The result covers only the data you pasted, not the rest of the prompt or the output tokens.

Mistakes that shrink your TOON savings

Where conversions disappoint.

None of these are flaws in the format so much as mismatched expectations. TOON is a specialist: it exists to make large, uniform, tabular data cheap inside prompts, and it should be judged on exactly that job.

  • Converting deeply nested or ragged data. Arrays whose objects carry different keys can't use the tabular form, so the saving is small and the panel can even show TOON costing more.
  • Comparing against pretty-printed JSON. The fair baseline is minified JSON, which is what this converter measures against.
  • Sending TOON to a strict JSON consumer. Function-calling schemas, REST endpoints, and tool outputs expect JSON and will reject anything else.
  • Leaving the model guessing. If the prompt never says the block is TOON, you're relying on the model to infer the format on its own.
  • Micro-optimizing tiny payloads. Below a few hundred tokens the savings rarely matter; the technique pays off on big tables.

TOON vs JSON in prompts: three practical tips

Getting the most from the converter.

First, try each delimiter from the menu beside the buttons: comma, tab or pipe. Comma is the easiest to read. Tab can save a few tokens when your values contain commas, because fewer cells need quoting. The delimiter is declared in each array header, so converting back works with any of them. Second, spend one prompt line on context, something like: the data below is in TOON, a compact tabular notation. It costs a dozen tokens and removes any ambiguity for the model.

Third, split your traffic sensibly. The choice isn't either-or: keep JSON for anything a parser consumes, and convert the bulky read-only context, the product tables and result sets, where the token meter actually runs. Test the model's answers on your own data before switching a production prompt, since results vary by model and task.

Where the JSON to TOON Converter sits among the JSON tools

Related tools on this site.

Validate and inspect before you convert: the JSON Validator confirms your payload parses, and the JSON Formatter makes it readable enough to sanity-check the values. If the data is headed for a spreadsheet rather than a model, the JSON to CSV Converter is the right table format, since Excel doesn't read TOON.

The JSON Minifier produces the baseline this converter measures against, and sometimes minified JSON alone is enough when data is small or deeply nested. For configuration meant for human editing, the JSON to YAML Converter optimizes for readability the way TOON optimizes for token count: the same family of conversions, tuned for different budgets.

Try it now

Open JSON to TOON Converter

The tool is one click away. No sign up, no upload, no payment.

Open JSON to TOON Converter