
If you’ve used tools like ChatGPT, Claude, or Gemini, you’ve already seen how powerful large language models can be. But behind every response, there’s something most people don’t notice: cost is tied directly to how much data you send.
Every prompt isn’t just a question. It often includes instructions, context, memory, and structured data. All of this gets converted into tokens, and more tokens mean higher cost and slower processing.
That’s where TOON comes in.
TOON (Token-Oriented Object Notation) is a more efficient way to represent structured data when working with AI. Instead of repeating the same fields over and over like traditional formats, it reduces redundancy while preserving meaning.
In this guide, you’ll learn what TOON is, how it works, and why it can significantly reduce token usage and improve performance in real AI systems.
TOON (Token-Oriented Object Notation) is a data representation format designed to reduce token usage when sending structured data to AI models. It works by minimising repetition in data structures while preserving the same meaning.
Unlike traditional formats like JSON, which repeat field names for every record, TOON defines the structure once and represents the data more compactly. This makes it more efficient for AI systems, where every extra token increases cost and processing time.
In simple terms, TOON is a smarter way to format structured data so AI models can process the same information using fewer tokens.
When you send a request to an AI model, it’s not just a question.
Behind the scenes, each request often includes instructions, documents, retrieved context, conversation history, and metadata.
All of this is converted into tokens, the unit that determines cost and processing time.
More tokens = higher cost and slower responses.
You’re not just sending data to AI - you’re paying for every repeated word.
What looks like a simple query can actually be hundreds or even thousands of tokens.
That’s where the real problem begins.
Because in production systems, this adds up quickly, increasing costs and reducing efficiency at scale.
So the real question is:
Can we send the same information in a more efficient way?
Most AI systems use JSON, a structured format to organise data before sending it to a model.
Here’s a simple example:
import json
payload = {
"task": "summarize",
"document": "Long report text...",
"metadata": {"source": "internal"}
}
prompt = json.dumps(payload)This entire payload is converted into text and sent to the model.
{
"teams": [
{
"name": "Team F22",
"members": [
{ "id": 1, "name": "Alice" },
{ "id": 2, "name": "Bob" }
]
}
]
}
JSON is widely used because it’s clear, readable, and easy to work with.
But there’s a hidden inefficiency.
Now consider a slightly larger dataset:
[
{"id":1,"name":"Phone","price":699},
{"id":2,"name":"Tablet","price":399},
{"id":3,"name":"Laptop","price":1299}
]At first glance, this looks fine.
But notice what’s happening:
For humans, this repetition doesn’t matter.
Walk away with actionable insights on AI adoption.
Limited seats available!
But for AI systems, every repeated key becomes a token, and tokens directly impact cost and performance.
That repetition adds up quickly.
TOON stands for Token-Oriented Object Notation.
It’s a data representation format designed to reduce repetition when sending structured data to AI models.
Instead of repeating the same keys for every record, TOON defines the structure once and represents the data more compactly.
This means the same information can be expressed using fewer tokens, without losing meaning or clarity.

Switching from JSON to TOON is straightforward. Instead of serializing data using JSON, you encode it using TOON.
Here’s a simple example:
pip install python-toonfrom toon import encode
prompt = encode(payload)That’s it.
You’re sending the same data, just in a more compact and efficient representation.
Here’s how the same data looks when represented using TOON:
teams[1]:
- name: Team F22
members[2]{id,name}:
1,Alice
2,BobInstead of repeating keys like “id” and “name” for every record, TOON defines the structure once and lists only the values.
This reduces repetition while keeping the data easy to understand.
TOON works best when the data you’re sending is structured and repetitive.
Think of cases where the same fields show up again and again, that’s exactly where TOON makes the biggest difference.
TOON is most effective when there’s repeated structure. When that structure is missing, there’s simply less to optimise.
If your data is mostly natural, free-form text, it’s already fairly compact and doesn’t repeat keys or patterns.
In these scenarios, TOON still works, but the gains are limited because the data is already expressed efficiently.
To understand where TOON helps, we ran experiments comparing JSON, TOON, and plain prompts across two scenarios:
This helps show when TOON really makes a difference.
| Format | Avg Prompt Tokens | Avg Completion Tokens | Avg Total Tokens | Avg Latency |
JSON | 4264 | 173 | 4437 | 4.15 s |
TOON | 2071 | 169 | 2240 | 3.82 s |
Result: About 51% reduction in prompt size using TOON.
When data contains repeated fields (like tables or logs), TOON dramatically reduces token usage, which translates directly into lower cost and faster processing.

| Format | Avg Prompt Tokens | Avg Completion Tokens | Avg Total Tokens | Avg Latency |
NORMAL | 2287 | 171 | 2458 | 4.15 s |
JSON | 2473 | 175 | 2648 | 3.73 s |
TOON | 2443 | 166 | 2609 | 3.27 s |
Result: Only small differences.
When most of the input is plain text, there’s very little repetition to compress, so TOON offers limited benefit.

These results point to a simple idea:
Walk away with actionable insights on AI adoption.
Limited seats available!
TOON works best when structure dominates the data.It matters less when the input is mostly natural text.
That’s exactly how real AI systems behave, structured data benefits the most, while free-form text sees limited gains.
As AI gets integrated into more products, the cost of running it becomes a real constraint.
It’s not just about choosing the right model - it’s also about how efficiently data is sent and processed.
In many systems, a large portion of tokens comes from structure, not actual content. That means small improvements in how data is represented can have a meaningful impact at scale.
As usage grows, these gains become more noticeable.
TOON doesn’t change how AI works, it improves how we communicate with it in scenarios where structure dominates.

TOON (Token-Oriented Object Notation) is a data format designed to reduce token usage when sending structured data to AI models by minimizing repeated fields.
JSON repeats field names for every record, while TOON defines the structure once and only sends the values, making it more compact.
No. TOON is most effective with structured, repetitive data. For natural language content, the impact is minimal.
Use TOON when working with structured data like tables, logs, search results, or large datasets with repeated fields.
It can. Fewer tokens mean less data to process, which can slightly reduce latency in many cases.
No. Switching from JSON to TOON is straightforward and usually only changes how data is serialized, not the data itself.
No. TOON changes the representation of input data, not the meaning, so output quality remains the same.
TOON doesn’t replace JSON, it improves how structured data is sent to AI models.
When data is repetitive, it can significantly reduce token usage. When it’s mostly natural language, the impact is minimal.
It doesn’t change what you send, only how efficiently it’s represented.
As AI systems scale, these small optimizations start to matter more. Because in the end, efficiency isn’t just about models, it’s also about how you communicate with them.
Walk away with actionable insights on AI adoption.
Limited seats available!