.toon · text/plain

TOON: Token-Oriented Object Notation

TOON combines YAML-like indentation for nested objects with CSV-like tabular headers (`items[N]{col1,col2}:`) to eliminate repeated JSON keys in LLM prompts.

Quick Answer: TOON combines YAML-like indentation for nested objects with CSV-like tabular headers (`items[N]{col1,col2}:`) to eliminate repeated JSON keys in LLM prompts. Cutting LLM prompt token costs by 30–60% when sending uniform JSON object arrays to GPT-5, Claude 4, or Gemini.

Structure typeHierarchical
Human readabilityHigh
Nesting supportYes
LLM token efficiencyHigh
File extension.toon
MIME typetext/plain
Best forCutting LLM prompt token costs by 30–60% when sending uniform JSON object arrays to GPT-5, Claude 4, or Gemini.

Strengths

  • Cuts LLM input token consumption by 30%–60% on structured record arrays
  • Preserves explicit array lengths and field headers so LLMs stay accurate
  • Losslessly round-trips back to typed JSON via @toon-format/toon

Trade-offs

  • Newer format not natively parsed by standard browser JSON APIs
  • Deeply irregular schemas with shifting keys save fewer tokens than uniform arrays
  • Requires encoding/decoding step at LLM input/output boundaries

References

Convert & clean TOON locally

Related engineering guides

Related Formats

All 24 formats

TOON frequently asked questions

How much does TOON reduce LLM token counts compared to JSON?

On uniform arrays of objects (database rows, API lists, catalog items), TOON typically reduces tokens by 35% to 60% by declaring keys once in the header.

Does TOON lose data types when converting back to JSON?

No. Strings, numbers, booleans, nulls, nested objects, and arrays round-trip accurately back into JSON.

Which delimiter works best inside TOON tabular blocks?

Comma is standard and human-friendly; tab (\t) or pipe (|) can save a few extra tokens in o200k_base when values contain spaces or commas.