toon

A compact, human-readable data format (TOON) that represents JSON more cheaply for LLM prompts. It comes with a TypeScript SDK, a CLI and benchmarks, and aims to cut token use.

Share on XLicense: MIT

Overview

TOON, short for Token-Oriented Object Notation, is a compact and readable way to write the JSON data model, designed to use fewer tokens in LLM prompts. It mixes YAML-style indentation for nested objects with CSV-style tables for uniform data. The idea is to keep JSON in your program and encode it as TOON only when sending it to a model. The repository has a TypeScript SDK, a CLI and benchmarks.

Key features

  • Lossless encoding of JSON data for LLM input
  • Indentation for nesting, table form for uniform arrays
  • TypeScript SDK and command-line tool
  • Benchmarks included

Best for

Developers who send lists of similar records to LLMs and want to trim token use. The README says deeply nested or non-uniform data may be more efficient as JSON.

Upstream
toon-format/toon
Fork on GitHub
Guo-astro/toon
Upstream stars
25k
Category
Developer tools and infrastructure
Language
TypeScript
License
MIT
Forked
2025-11-09
Sync status
In syncLast synced 2026-09-29