toon-format/toon

🎒 Token-Oriented Object Notation (TOON) – compact, human-readable serialization of JSON data for LLM prompts. TypeScript SDK, CLI, benchmarks.

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 27 minutes ago
Added to GitGenius on September 1st, 2026
Created on October 22nd, 2025
Open Issues & Pull Requests: 4 (+0)
GitHub issues: Enabled
Number of forks: 1,118
Total Stargazers: 25,330 (+0)
Total Subscribers: 121 (+0)

Repository Insights (GitGenius)

Most active contributors

Sign in to see contributor activity.

Related repositories by overlapping contributors

No overlapping-contributor repos identified yet.

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Issue API getrepoissuespagesummary failed: 429 Rate limit exceeded. Please try again later.

Detailed Description

Toon is a compact serialization format that encodes JSON data into a token-efficient representation optimized for use in large language model prompts.

The format addresses the problem that JSON's structural overhead consumes significant tokens when passed to LLMs, which charge by token count. Toon solves this by combining YAML-style indentation for nested objects with CSV-style tabular forms for uniform data. It automatically selects the most compact representation based on data shape: inline form for primitive arrays, tabular form for arrays of uniform objects, keyed tabular form for objects whose values are uniform objects, and list form as a fallback for mixed or non-uniform data. The encoding is lossless and reversible, functioning as a translation layer between JSON used programmatically and a more compact representation for LLM input.

Developers should choose Toon when working with LLM prompts containing structured data where token efficiency matters economically. It suits datasets with uniform objects—arrays of items with consistent fields or records keyed by ID—where it can achieve compression comparable to CSV while maintaining explicit structure. The format is less efficient for deeply nested or non-uniform data, where JSON may be preferable. The project provides a TypeScript SDK and CLI tool, allowing developers to convert existing JSON without changing their data pipeline.

The project maintains an active specification repository separate from the implementation, inviting community contribution to the format design itself. Development includes benchmarking tools that measure token savings on real data. The maintainers explicitly acknowledge the format as stable but still evolving, positioning it as collaborative rather than finalized.