Home / Companies / LogRocket / Blog / Post Details
Content Deep Dive

How to use TOON to reduce your token usage by 60%

Blog post from LogRocket

Post Details
Company
Date Published
Author
Rosario De Chiara
Word Count
1,613
Language
-
Hacker News Points
-
Summary

Token-Oriented Object Notation (TOON) is a serialization format specifically designed for large language model (LLM) prompts, aimed at reducing token usage while maintaining data structure and readability. Unlike traditional JSON, TOON minimizes token count by declaring array lengths and field names only once and using compact syntax, such as indentation and alternate delimiters, to avoid repeating keys for uniform arrays of objects. This results in significant token savings of 30–60% compared to JSON under optimal conditions, though TOON is not suitable for deeply nested or non-uniform data. While TOON can offer cost and performance benefits for structured, repetitive data, it requires users to familiarize themselves with its syntax and may not outperform simpler formats like CSV for purely tabular data. Despite its advantages, the newness of TOON means that LLMs may need explicit guidance or examples to recognize and use the format, and it may not be immediately compatible with existing systems that predominantly use JSON.