BASICS
Nov 13, 2025
5 min read

What is Token-Oriented Object Notation?

A comprehensive guide to understanding TOON format and why it's revolutionizing data serialization for Large Language Models.

Introduction

Token-Oriented Object Notation (TOON) is a serialization format specifically designed for Large Language Models (LLMs). Unlike traditional formats like JSON or XML, TOON prioritizes token efficiency while maintaining human readability and schema awareness.

Why TOON Was Created

As AI applications became more prevalent, developers faced a critical challenge: token limits and costs. Every API call to GPT-4, Claude, or other LLMs is charged per token, and context windows are limited.

Traditional JSON format, while ubiquitous, is highly inefficient for LLMs:

  • Repeats key names for every object in an array
  • Uses verbose syntax with brackets, quotes, and colons
  • Wastes tokens on formatting that LLMs don't need

TOON solves these problems by introducing a header-based format that declares the schema once and then only includes values.

How TOON Works

Example: JSON vs TOON

JSON Format (verbose):

[
  {"name": "Alice", "age": 30, "city": "NYC"},
  {"name": "Bob", "age": 25, "city": "LA"},
  {"name": "Charlie", "age": 35, "city": "SF"}
]

Tokens: ~45

TOON Format (compact):

items[3]{name,age,city}:
  Alice,30,NYC
  Bob,25,LA
  Charlie,35,SF

Tokens: ~18 (60% reduction)

TOON Syntax Breakdown

  • 1.
    Header: items[3]{name,age,city}:
    Declares 3 items with fields: name, age, city
  • 2.
    Values: Each row contains comma-separated values
    No need to repeat key names
  • 3.
    Indentation: Optional spaces for readability
    Configurable (0, 2, 4, or 8 spaces)

Key Benefits of TOON

💰 Cost Savings

Reduce token usage by 30-60%, directly lowering API costs for GPT-4, Claude, and other LLMs.

📊 More Data in Context

Fit more structured data within the same context window limits, crucial for RAG systems.

🔍 Better Accuracy

Studies show 73.9% retrieval accuracy with TOON vs 69.7% with JSON for structured queries.

👁️ Human Readable

Unlike binary formats, TOON remains readable and debuggable by developers.

When to Use TOON

✅ Perfect For:

  • Database query results with tabular data
  • API responses with repeated object structures
  • RAG systems embedding structured knowledge
  • CSV conversions for LLM processing
  • Analytics datasets in prompts

❌ Not Ideal For:

  • Deeply nested objects with varying schemas
  • Single objects (no benefit over JSON)
  • Binary data or media files
  • Inter-service communication (use JSON for compatibility)

Getting Started with TOON

Converting your JSON data to TOON is simple:

  1. Use our free online converter
  2. Paste your JSON data
  3. Configure options (delimiter, indentation)
  4. Click Convert and download the TOON file

Pro Tip: For programmatic conversion, check out the official TOON libraries for Python, JavaScript, and TypeScript on GitHub.

Conclusion

TOON represents a paradigm shift in how we serialize data for LLMs. By prioritizing token efficiency without sacrificing readability, it enables developers to build more cost-effective and performant AI applications.

Whether you're working on RAG systems, prompt engineering, or any data-heavy LLM application, TOON should be in your toolkit. Start converting today and see the token savings for yourself.

Ready to Try TOON Format?

Convert your JSON to TOON instantly with our free online converter

START_CONVERTING