News

TOON: the data format that reduces AI costs and optimizes token usage

TOON: the data format that reduces AI costs and optimizes token usage

Why TOON is more efficient than JSON when communicating with AI models

Artificial intelligence has become integrated into all kinds of modern applications: virtual assistants, process automation, advanced analytics, recommendation engines, and much more. But behind every interaction with an AI model, there is a factor that is often overlooked: each request has a cost, and that cost depends directly on the amount of information we send to the model.

This information is measured in tokens, minimal units that include words, symbols, and fragments of text. The more tokens you send, the higher the cost. And here lies a key issue: the most commonly used data format, JSON, contains a large amount of syntactic elements that increase token consumption without adding real value for the AI.

To solve this inefficiency, TOON (Token-Oriented Object Notation) emerges as a new data format designed specifically to communicate with language models in a more economical, compact, and efficient way.

The problem with JSON in AI environments

For years, JSON has been the standard for data exchange due to its clarity, compatibility, and ease of use. However, when communication is directly with a language model, it presents limitations that translate into unnecessary costs.

The first problem is symbols: braces, quotation marks, brackets, and commas are essential for a program to understand structure, but an AI model does not need this “visual decoration.” All these symbols become additional tokens that increase cost without adding semantic information.

But the most significant problem appears when working with lists (sets of records). If a list includes hundreds or thousands of items, the field names are repeated over and over again.

For example, in GPT-3.5 and GPT-4 models, a simple JSON representing basic data of three users consumes about 54 tokens:

				
					[
  { "name": "Alice", "email": "alice@example.com" },
  { "name": "Bob", "email": "bob@example.com" },
  { "name": "Carol", "email": "carol@example.com" }
]
				
			


The same data in TOON format consumes only 29 tokens, a 46% reduction:

				
					
items[3]{name,email}:
  Alice,alice@example.com
  Bob,bob@example.com
  Carol,carol@example.com
  
				
			


The difference is remarkable: in TOON, field names are declared only once in the schema, and the data is presented in a tabular format without repetition. This reduction may seem small in a tiny example, but when scaled to thousands of records, the economic impact becomes substantial.

Essentially, JSON was designed for human readability and system interoperability. AI models, however, can work with much more compact structures without losing understanding. Processing all that decorative syntax means spending unnecessary tokens which, in large-scale applications, turn into real and ongoing costs.

TOON: efficiency without sacrificing structure

In response to these limitations, TOON is based on a simple principle: remove everything the model does not need and keep only the relevant information. It behaves like JSON in terms of structure and expressiveness, but represents it in a more compact way.

Additionally, the benefit is not only economic. Fewer tokens also mean less workload for the model, which results in faster responses. In high-concurrency systems, where every millisecond counts, this efficiency can significantly improve user experience.

Moreover, explicit schemas help the model interpret data with greater structural clarity, reducing ambiguities and potentially improving the quality of generated responses.

When to use TOON and when not

TOON is particularly valuable in specific scenarios. If an application analyzes large volumes of structured data —for example, processing records of tens of thousands of users, where JSON might consume 500K tokens versus 250K with TOON— the savings are substantial.

The same applies to batch processing systems that analyze logs, transactions, or metrics at scale, or for startups and projects where every euro of the AI budget matters.

However, TOON does not fully replace JSON in all contexts. Public APIs will continue to use JSON for reasons of universal compatibility and established web standards. In highly irregular structures or deeply nested heterogeneous data, savings may be lower and readability could be compromised.

The tool ecosystem —parsers, validators, debuggers— for JSON remains broader and more mature. And for extremely simple cases, formats like CSV can be even lighter.

For this reason, the most practical strategy is to keep JSON in the general application architecture and convert to TOON only at the communication point with the AI model.

In a world where every token counts and AI budgets can escalate quickly, adopting formats like TOON is a strategic decision for organizations operating at scale. It is not about abandoning proven standards, but about using the right tool for each context.

JSON will remain essential for web interoperability, but when communication is directly with AI models, TOON positions itself as a more efficient option for those looking to optimize costs without sacrificing clarity.

Take your AI strategy to the next level with IThinkUPC

At IThinkUPC, we don’t just identify solutions like TOON for cost and token optimization; we are experts in the strategic application of Artificial Intelligence. If your organization seeks to go beyond immediate savings and wants to develop robust, efficient AI use cases that generate real value, our team is ready to guide you. We will help you select the most suitable models, optimize their data formats, and design an AI architecture that guarantees maximum performance with minimum investment. Contact us today to transform the potential complexity of AI into a clear and measurable competitive advantage.

Share on social media:

News and references from the business line

Menú

Cercador