.toontext/plainLLM & Streaming Formats

Token-Oriented Object Notation (TOON)

Shrinking LLM prompt payloads, RAG context tables, and agent tool responses by 30%–60% tokens without losing JSON data fidelity.

Quick Answer

TOON (Token-Oriented Object Notation) is a lossless, human-readable data serialization built for LLMs that folds uniform object arrays into schema-declared tabular blocks with explicit row counts.

TOON · Format specs
PropertyTOON
File extension.toon
MIME typetext/plain
Structure typeHierarchical
EncodingUTF-8 Text
Nesting supportYes
LLM token efficiencyHigh
Schema / typedYes
Best forShrinking LLM prompt payloads, RAG context tables, and agent tool responses by 30%–60% tokens without losing JSON data fidelity.

Strengths

  • Cuts GPT-4o / Claude / Gemini prompt tokens by 35%–60% on uniform arrays of objects
  • Declares explicit array lengths and field headers (users[3]{id,name}:) to improve LLM parsing accuracy
  • 100% lossless round-trip conversion back to typed JSON booleans, numbers, nulls, and nested objects

Trade-offs

  • Newer format requiring conversion back to JSON if downstream consumers expect standard REST JSON
  • Deeply irregular, non-uniform nested objects see smaller token gains than flat or tabular records
  • Strict array-length checks reject truncated payloads unless strict mode is disabled

Convert & inspect TOON locally

Related engineering guides

Related Comparisons

TOON frequently asked questions

Is TOON lossless when converting back to JSON?

Yes. TOON preserves strings, numbers, booleans, nulls, nested objects, and arrays identically through the official @toon-format/toon specification.

How much cheaper is TOON than JSON in GPT-4o prompts?

Uniform arrays like user lists, order tables, or search results typically drop 40%–60% in o200k_base BPE tokens compared to formatted JSON.

Can I convert CSV or YAML straight to TOON?

Yes. DataTo converts JSON, CSV/TSV, and YAML directly into TOON in browser RAM and shows live GPT-4o BPE token savings.

Authoritative References

Explore other formats

All 14 formats →