TOON Format Specification
February 23, 2026 ยท View on GitHub
This repository contains the official specification for Token-Oriented Object Notation (TOON), a compact, human-readable encoding of the JSON data model for LLM prompts. It provides a lossless serialization of the same objects, arrays, and primitives as JSON, but in a syntax that minimizes tokens and makes structure easy for models to follow.
๐ Specification
โ Read the full specification (SPEC.md)
- Version: 3.0 (2025-11-24)
- Status: Working Draft
- License: MIT
The specification includes complete grammar (ABNF), encoding rules, validation requirements, and conformance criteria.
What is TOON?
Important
For a high-level overview of TOON, its features and benefits, design goals, and comparisons to other formats, see the toon-format/toon repository.
Serialization Example
| JSON | TOON |
|---|---|
|
|
Reference Implementation
The reference implementation in TypeScript/JavaScript is maintained at: github.com/toon-format/toon
The reference implementation includes:
- Complete encoder and decoder
- CLI tools for JSON โ TOON conversion
- Performance benchmarks
Community Implementations
Official community-driven implementations are currently being developed at the github.com/toon-format organization.
Test Fixtures & Conformance
The tests/fixtures/ directory contains language-agnostic JSON test fixtures for validating TOON implementations. Each fixture file contains test cases with input/output pairs covering all specification requirements.
What's included:
- Encoding tests: JSON โ TOON conversion
- Decoding tests: TOON โ JSON parsing
- Error cases: Validation and strict mode checks
- Edge cases: All corner cases from the specification
For implementers:
- Load JSON fixtures from
tests/fixtures/encode/andtests/fixtures/decode/. - Run each test case against your implementation.
- Report results using the conformance badge system.
See tests/README.md for detailed fixture format and usage instructions.
Media Type & File Extension
TOON defines a provisional media type (see ยง18.2 of the specification):
- Media type:
text/toon(provisional, pending IANA registration) - File extension:
.toon - Charset: Always UTF-8
For HTTP usage:
Content-Type: text/toon
See the full IANA Considerations section for details.
Contributing
We welcome contributions to improve the specification! Please see CONTRIBUTING.md for:
- How to propose spec changes
- The RFC process for major changes
- Guidelines for submitting issues and pull requests
For implementation-specific questions or bugs, please refer to the respective implementation repository.
Versioning
The TOON specification follows semantic versioning. See VERSIONING.md for our versioning policy and compatibility guarantees.
Resources
- Specification: SPEC.md - Complete formal specification with ABNF grammar
- Examples: examples/ - Working examples organized by feature
- Test Fixtures: tests/fixtures/ - Comprehensive test suite
- Changelog: CHANGELOG.md - Version history and changes
- Reference Implementation: github.com/toon-format/toon - TypeScript/JavaScript implementation
- Benchmarks: Reference repo benchmarks/ - Token efficiency measurements and accuracy retrieval tests
License
MIT License ยฉ 2025-PRESENT Johann Schopplich