
DevOp.Toon is a .NET SDK and integration framework for working with TOON (Token-Oriented Object Notation), enabling efficient, structured communication with LLMs and APIs.
It is built for teams that care about transport efficiency, storage footprint, and predictable application integration. You can use it as a simple serializer, a reusable DI service, or a bridge between JSON and TOON while you adopt the format incrementally.
DevOp.Toon implements the Toon Format and extends the protocol with additional optimizations to further reduce token count and payload size.
The existing Toon Format Dotnet reference implementation showed promising size gains but had significant performance gaps relative to System.Text.Json. Rather than patching the upstream project, DevOp.Toon was built from the ground up to close those gaps — resulting in the DevOp.Toon, DevOp.Toon.Core, and DevOp.Toon.API package family.
- 📦 Up to 77.7% smaller payloads vs JSON (real-world product dataset, 2,051 items)
- ⚡ Up to 2.02× faster encoding on large structured payloads vs System.Text.Json
- ⚡ Up to 1.40× faster decoding on real-world data
- 🚀 Faster API responses — TOON HTTP responses measured ~0.6 ms faster than JSON equivalents
Up to 77.7% smaller than JSON
TOON removes repeated keys and compresses structure:
- Real-world 2,051 product file: 77.7% smaller
- Warehouses dataset: 76.4% smaller
- Flat orders: 63.5% smaller
- Products (1,000 items): 56.4% smaller
Savings continue even after compression:
- Warehouses: 20.1% smaller with gzip
- Flat orders: 15.7% smaller with gzip
- Real-world products file: 15.9% smaller with gzip
Faster where it matters
- Products encode (1,000 items): 2.02× faster than System.Text.Json
- Real-world file decode: 1.40× faster
- Change-field style data decode: 1.96× faster
- API response time: consistently faster at the HTTP layer
DevOp.Toon is optimized for real-world data:
- Best gains on repeated structures (arrays, datasets)
- Products-scale encode is faster than System.Text.Json
- Encode on smaller flat datasets is slightly slower than STJ (the columnar planning has overhead that pays off at scale)
- Designed for typed serialization, not DOM parsing
Use TOON when:
- You send structured data over APIs
- You care about payload size
- You work with large datasets or LLMs
- Smaller payloads → faster APIs
- Fewer tokens → lower LLM costs
- Structured format → better AI parsing
DevOp.Toon is designed for:
- High-throughput APIs
- Data-heavy services
- AI / LLM integrations
- Payloads can be materially smaller than JSON on repeated-row and nested business data.
- Savings often remain even when HTTP compression is already enabled.
- The runtime integrates naturally into modern .NET applications.
ToonEncoder for writing TOON
ToonDecoder for reading TOON
ToonService and IToonService for application-level use
AddToon(...) for dependency injection
- JSON-to-TOON and TOON-to-JSON conversion paths
This package is strongest when payloads contain repeated object rows, nested collections, or catalog-style business data, for example:
- product catalogs
- warehouse snapshots
- audit histories
- configuration payloads
- batched API responses
If you are evaluating the package for the first time, read these pages in order:
- Why TOON
- Installation and Package Selection
- Quick Start
- Using ToonService and DI
- Performance and Benchmarks
For engineering readers: protocol notes, API reference, build configuration, and contributor guidance are included later in the tree so the space stays approachable for new users.
https://www.nuget.org/packages/DevOp.Toon
