Beyond JSON: How TOON Can Cut Your LLM API Costs by 50%
The verbosity of JSON is costing your team money. Learn how Token-Oriented Object Notation (TOON) can reduce your LLM API token usage for structured data by up to 50%.

The verbosity of JSON is costing your team money. Learn how Token-Oriented Object Notation (TOON) can reduce your LLM API token usage for structured data by up to 50%.

For two decades, JSON (JavaScript Object Notation) has been the universal language of the web. It's human-readable, simple, and the gold standard for API data exchange.
But as LLMs came up they have exposed a costly flaw in JSON: It is incredibly verbose.
In the world of LLMs, every character-every brace, every quote, every comma, and every repeated key-is converted into tokens. Tokens are the currency of AI. If you're passing a large array of uniform structured data (like a list of 50 users or 100 products) to an LLM for summarization, reasoning, or function calling, you are paying a massive Token Tax simply to transmit syntactic clutter.
We need a format that is:
Enter TOON (Token-Oriented Object Notation).
TOON is a new data serialization specification designed with one primary goal: To drastically reduce the token count when exchanging structured data with AI.
Instead of relying on the verbose, character-based syntax of JSON, TOON uses a compact, tabular style that aligns closely with how LLMs naturally process organized information.
The most immediate benefit is clear when comparing a common structure: an array of objects.
JSON: 51 tokens (approx.) vs. TOON: 20 tokens (approx.)
Here is the data for two users, first in JSON, then in TOON:
JSON Representation
1{2"users": [3{ "id": 1, "name": "Alice", "role": "admin" },4{ "id": 2, "name": "Bob", "role": "user" }5]6}
TOON Representation
1users[2]{id,name,role}:21,Alice,admin32,Bob,user
Notice the critical difference in the TOON format:
users[2]{id,name,role}:This single line is the Schema Declaration. It tells the parser (and the LLM):
users: The key name for the object.[2]: This is an array with 2 elements.{id,name,role}: The fields that apply to every element in the array.The subsequent lines simply become data rows, removing every repeated key, quote, colon, and brace-achieving token savings of 30% to 50% for uniform data sets.
For developers, the move to TOON isn't just a philosophical choice; it delivers quantifiable benefits:
You don't need to hand-write TOON. Official packages are available to automatically encode your existing data structures (like JSON objects) into the TOON format and decode them back.
Use the official NPM package to start converting JSON data instantly:
1npm install @toon-format/toon
1import { encode, decode } from "@toon-format/toon";23const jsonData = {4channel: { name: "tapaScript", type: "education" }5};67// JSON => TOON8const toonString = encode(jsonData);9console.log(toonString);10/* Output:11name: tapaScript12type: education13*/1415// TOON => JSON16const jsonObject = decode(toonString);
The python-toon package makes implementation just as straightforward:
1pip install python-toon
1from toon import encode, decode23# JSON => TOON4channel = {"name": "dataPipeline", "version": 1.0}5toon_output = encode(channel)6print(toon_output)7"""8Output:9name: dataPipeline10version: 1.011"""1213# TOON => JSON14python_struct = decode(toon_output)
TOON is an augmentation to JSON, not a universal replacement. JSON is still superior when:
The smartest approach is often a hybrid model: Use JSON for application-to-application data transfer, but convert it to TOON only when sending that structured data to your LLM endpoints.
Optimizing your data formats is critical for controlling cost and performance. Equally critical is ensuring the quality and integrity of the code those LLMs are generating and interacting with.
At Olymp Labs, we are building the security engine for developers. We help your team enforce the core patterns that guarantee scalability, maintainability, security, and compliance - turning fast, functional code into production-ready software.
Next time you're optimizing an AI-driven service, give TOON a try. And if you need help securing the resulting code, let's talk.