Shrink JSON for LLM prompts with TOON. Paste JSON and get TOON — a compact notation that writes arrays of similar objects as a table with a single header — or paste TOON to get JSON back. See the size difference against pretty and minified JSON, with every conversion verified to round-trip.
| JSON | TOON |
|---|---|
| {"tags":["a","b"]} | tags[2]: a,b |
| {"items":[{"id":1,"qty":2},{"id":2,"qty":5}]} | items[2]{id,qty}: 1,2 2,5 |
Token-Oriented Object Notation, a compact, human-readable encoding of JSON designed for LLM prompts.
Most on arrays of same-shaped objects — often 30–60% versus pretty JSON. Deeply nested or irregular data saves less.
Yes. Each conversion is decoded back and checked against the input.
Comma is most readable; tab often tokenizes smallest.
No, they're a 4-characters-per-token estimate. Use the LLM Token Counter for exact numbers.
The encoder implements the core syntax of TOON spec 1.x: - **Objects:** key: value lines with two-space indentation. - **Plain-value arrays:** written inline with their length, such as tags[2]: a,b. - **Same-shape object arrays:** where every object has the same primitive fields, written once as a header (items[2]{sku,qty}:) followed by one delimited row per item. This removes the repeated keys and punctuation that make JSON expensive. - **Mixed arrays:** fall back to - list items. Strings are quoted only when they would be ambiguous: empty, padded, containing the delimiter, a colon or brackets, or looking like a number, boolean or null. Comma, tab or pipe can be the delimiter. Every conversion is decoded again and compared with the input to verify it round-trips. The decoder also validates the declared array lengths and row widths.