TOON is a compact, human-readable encoding of the JSON data model designed to minimize LLM token usage. It converts uniform arrays into tabular structures and reports approximately 40% token savings compared to standard JSON.
Project overview
The project reports reducing token consumption by roughly 40% compared to standard JSON while maintaining lossless round-trips, addressing prompt length constraints and costs for LLM inputs.
Project type
Data Processing · Prompt Engineering
Deployment
Refer to project documentation
License
MIT
Best for
Developers, AI engineers, and data teams seeking a lossless, drop-in representation of JSON that uses fewer tokens for LLM inputs.
Key capabilities
Supports deterministic, lossless conversions between JSON and TOON representations.
Transforms uniform arrays of objects into tables that declare fields a single time and stream row values line by line.
Includes explicit array lengths and field headers to provide a clear schema for models to follow during parsing.
Limitations and risks
For deeply nested or non-uniform structures, JSON-compact formatting frequently uses fewer tokens than TOON.
For pure flat tables, CSV encoding is smaller than TOON.
The format is stable, but the underlying concept remains a work in progress and subject to change.
Getting started
Installation difficulty is rated as easy. Users can install TOON via npm or try it instantly using npx.
Alternatives and comparisons
Streamlines the tuning process for GenAI app prompts and configurations to reduce inference costs.
A collection of system prompts and custom instructions for various LLM providers and solutions.
Provides millions of Stable Diffusion generated images with prompts for research in prompt engineering.
README: **Token-Oriented Object Notation** is a compact, human-readable encoding of the JSON data model that minimizes tokens and makes structure easy for models to follow. It's intended…
README: AI is becoming cheaper and more accessible, but larger context windows allow for larger data inputs as well. **LLM tokens still cost money** – and standard JSON is verbose and tok…
README: - 📊 **Token-Efficient & Accurate:** TOON reaches 76.4% accuracy (vs JSON's 75.0%) while using ~40% fewer tokens in mixed-structure benchmarks across 4 models. - 🔁 **JSON Data Mode…