September 3, 2026 · Yunus Emre Vurgun

Cutting Prompt Tokens with TOON: A Worked Example

toon · tokens · tutorial

TOON (Token-Oriented Object Notation) removes the repeated keys that make JSON expensive in prompts. Here is the effect on a real dataset — TCP/IP Protocol Suite — fetched live from this site.

The numbers

  • JSON payload: 847 bytes
  • TOON payload: 484 bytes (−43%)
  • Typical token savings across the catalog: 30–60% (see the measured comparison)

What changes

JSON repeats "layer" and "protocols" on every row. TOON declares the shape once — [4]{layer,protocols} — then lists bare rows. Same facts, no repeated keys, tabular layout models parse cleanly.

data
  [4]{layer,protocols}:
    Application,"HTTP, HTTPS, FTP, SMTP, DNS, SSH"
    Transport,"TCP, UDP"
    Internet,"IP, ICMP, ARP, IGMP"
    "Network Access","Ethernet, Wi-Fi, PPP"

Try it

Append ?format=toon to any dataset URL — for example /api/dataset/tcp-ip-protocol-suite?format=toon — and compare against ?format=json. Every endpoint in the API docs supports all three formats, and the homepage showdown visualizes the difference.