{·}jsontools.me
TOON · TOKEN-ORIENTED OBJECT NOTATION

What is TOON?

A compact encoding built for LLM prompts: how its tabular form removes repeated keys, and when it beats JSON on token count.

5 minute read · Updated August 2026

A format shaped by tokenisers, not parsers

TOON encodes the same data model as JSON — objects, arrays, strings, numbers, booleans, null — but chooses a syntax that costs fewer tokens when passed to a language model. Every brace, bracket, quote, and repeated key in a JSON payload is billed on the way in and consumes part of the context window. TOON removes the ones that carry no information.

It borrows indentation from YAML for structure, and a header-plus-rows layout from CSV for uniform arrays. The result reads like a hybrid because it is one.

service: checkout-api
orders[2]{id,status,total,currency}:
  ord_101,paid,129.5,USD
  ord_102,failed,42,USD

The tabular form is where the saving is

When an array holds objects that share the same keys, TOON writes the field names once in a header — orders[2]{id,status,total,currency} — and then one comma-separated row per element. The declared length and the field list are part of the syntax, which also gives a model a checkable structure: it can see that four fields and two rows were promised.

Compare the shapes. The JSON version of that array repeats id, status, total, and currency on every element, along with their quotes, colons, and braces. At two rows the saving is modest; across a few hundred rows of uniform records the repeated keys dominate the payload, and removing them is the difference between fitting in a context window and not.

When it does not help

TOON is optimised for uniform arrays of flat objects. Deeply nested or irregular data cannot use the tabular form, so it falls back to a list form and the advantage largely disappears — for those shapes, minified JSON may well be cheaper. It is worth measuring on your actual payload rather than assuming.

It is also not an interchange format. Ordinary JSON is what you send to an API; TOON is what you put in a prompt when the payload is large, uniform, and read by a model rather than a parser. Converting back to JSON returns the same data model, so nothing is lost by using it only at that boundary.