Sabuj Kundu 9th Nov 2025

What is TOON?

TOON stands for Token-Oriented Object Notation. It’s a new serialization format designed specifically for Large Language Models (LLMs) to minimize token usage while maintaining data structure. Instead of sending verbose JSON or YAML, TOON represents data in a more compact, token-efficient format.

In short: less redundancy, smaller payload, same meaning. This means faster performance and lower costs when interacting with LLM APIs.

Why TOON Matters

Every extra character in structured data (quotes, commas, brackets, etc.) costs tokens — and therefore money — when sending to an LLM. TOON aims to reduce that waste. The creators claim 30–60% fewer tokens compared to JSON for structured datasets.

  • ✅ Efficient for large, uniform datasets.
  • ✅ Human-readable yet compact.
  • ✅ Designed with LLMs and tokenization behavior in mind.
  • ⚠️ Still a developing ecosystem — limited tooling support.

TOON Syntax and Examples

TOON’s syntax is simple and eliminates redundant characters while maintaining hierarchy through indentation and minimal delimiters.

Basic Object

{
  "name": "Alice",
  "age": 30
}
name: Alice
age: 30

Array of Uniform Objects (Its Sweet Spot)

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob", "role": "user" }
  ]
}
users[2]{id,name,role}:
  1,Alice,admin
  2,Bob,user

How to read this:

  • users[2] = array length 2.
  • {id,name,role} = defines field headers once.
  • Subsequent rows contain values for those fields.

Nested Objects and Arrays

items[1]:
  - users[2]{id,name}:
      1,Ada
      2,Bob
    status: active

Primitive Array Inline

tags[3]: admin,ops,dev

Delimiters and Rules

  • Default delimiter: , (comma)
  • Can switch to \t (tab) or | (pipe) for efficiency
  • Strings are only quoted when necessary (spaces, delimiters, etc.)

Where TOON Shines — and Where It Doesn’t

✅ Ideal Scenarios

  • Large arrays with uniform structure (like logs, records, reviews)
  • When feeding data into LLMs where token count matters
  • When you control both encoding and decoding (internal systems, not public APIs)

⚠️ Not Ideal When

  • Data is deeply nested or irregular (varying keys)
  • You rely on standard JSON tooling or third-party APIs
  • Model comprehension matters more than size (most LLMs have seen more JSON in training)

How You Might Use TOON in WordPress or API Projects

  • Convert large plugin usage datasets or analytics logs to TOON before sending to LLM APIs.
  • Use TOON serialization internally in a WordPress plugin that processes structured user data (reviews, feedback, etc.).
  • Integrate a CLI or PHP helper that converts JSON → TOON → JSON for testing and benchmarking token savings.

For example, you might serialize WordPress plugin logs to TOON to reduce OpenAI API costs while retaining readability and structure.

Benchmark & Comparison

Format Token Count (favorable data) Human Readability Tooling Availability
JSON Baseline High Excellent
YAML Similar / slightly less Very high Good
TOON ~30–60% fewer tokens Moderate–high Growing

Final Thoughts

TOON isn’t here to replace JSON yet — but it’s a clever step toward more efficient data exchange with LLMs. For developers who regularly serialize structured data, especially in cost-sensitive environments, TOON can reduce payload size and API costs significantly.

In plugin or API development, treat TOON as an optimization tool rather than a full replacement. JSON remains universal, but TOON can shine in performance-critical or LLM-integrated workflows.

References:

Need to build a Website or Application?

Since 2011, Codeboxr has been transforming client visions into powerful, user-friendly web experiences. We specialize in building bespoke web applications that drive growth and engagement.

Our deep expertise in modern technologies like Laravel and Flutter allows us to create robust, scalable solutions from the ground up. As WordPress veterans, we also excel at crafting high-performance websites and developing advanced custom plugins that extend functionality perfectly to your needs.

Let’s build the advanced web solution your business demands.