finds.dev← search

// the find

toon-format/toon

★ 24,975 · TypeScript · MIT · updated Jul 2026

🎒 Token-Oriented Object Notation (TOON) – Compact, human-readable, schema-aware JSON for LLM prompts. Spec, benchmarks, TypeScript SDK.

TOON is a new serialization format for feeding structured data to LLMs that cuts tokens by combining YAML-style indentation with CSV-style tabular rows for uniform arrays. The headline claim is ~40% fewer tokens than JSON with comparable comprehension accuracy. It's aimed at developers who are paying real money for context and are passing lots of structured data in prompts.

- The benchmarks are unusually honest: 5,856 LLM calls across 4 models, 13 datasets, 244 questions, with Wilson confidence intervals on every number. Most format-comparison projects cherry-pick one model and one dataset.

- The [N] length and {fields} header annotations are genuinely novel — they give models explicit structural metadata that lets them detect truncation and width mismatches in ways JSON, YAML, and CSV fundamentally cannot. The structural validation dataset numbers (TOON 100%, JSON 0-75%) demonstrate this concretely.

- Token savings are real for the target case: 41-66% vs JSON for high-tabular-eligibility datasets. The flat-only track stays within 6% of CSV while adding structure that actually helps models.

- The ecosystem is surprisingly complete for a format this new: TypeScript SDK, CLI, VS Code extension, tree-sitter grammar, Python/Go/Rust/.NET implementations, a playground, and a versioned spec. Someone put serious work in.

- The accuracy advantage is statistically thin — TOON 72.2% vs JSON-pretty 71.4%, both with ±2.8% confidence intervals that overlap. The real pitch is cost reduction, not comprehension improvement, and the README buries that.

- The format degrades badly when data isn't clean enough to tabulate: semi-uniform event logs (50% eligibility) show TOON using 19.9% MORE tokens than compact JSON. If you don't know ahead of time how uniform your data is, you need to analyze it before choosing the encoding.

- The spec is explicitly unstable ('nothing's set in stone') while the star count is enormous. A breaking spec change at v5.0 will strand everyone who built parsers against v4.0, and there's no backwards-compatibility story described.

- You're adding a dependency and a new syntax that models need to be taught via examples in your system prompt — the integration guide admits you need to show a worked example before TOON clicks. For small payloads or one-off prompts, the overhead of explaining the format likely erases any token savings.

View on GitHub → Homepage ↗

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →