reduce_llm_tokens()
TOON serialization eliminates redundant JSON syntax — brackets, braces, and repeated keys — cutting tokens by up to 60%.
TOON (Token-Oriented Object Notation) is a compact serialization format built for LLM prompts. Lower your GPT and Claude API costs with fast, lossless, bidirectional json ↔ toon conversion.
$ jsontotoon convert --in users.json --out users.toon
✓ parsed 3 records · json 156 tokens
✓ wrote users.toon · toon 68 tokens (-56%)
# users.toon
users[3]:
id: 1, 2, 3
name: Alice Johnson, Bob Smith, Carol Davis
role: admin, user, user█
The same user list in JSON and in TOON. TOON writes each key once and lays values out in a compact table — 56% smaller.
{
"users": [
{
"id": 1,
"name": "Alice Johnson",
"email": "alice@example.com",
"role": "admin"
},
{
"id": 2,
"name": "Bob Smith",
"email": "bob@example.com",
"role": "user"
},
{
"id": 3,
"name": "Carol Davis",
"email": "carol@example.com",
"role": "user"
}
]
}
# 56% fewer tokens, same data
users[3]:
id: 1, 2, 3
name: Alice Johnson, Bob Smith, Carol Davis
email: alice@example.com, bob@example.com, carol@example.com
role: admin, user, user
| feature | json | toon |
|---|---|---|
| token efficiency | high redundancy | 30–60% reduction |
| human readability | good | excellent |
| api cost savings | standard costs | significant savings |
| llm compatibility | universal | gpt, claude, gemini |
| repeated keys | every object | only once |
| array syntax | verbose brackets | compact tabular |
TOON serialization eliminates redundant JSON syntax — brackets, braces, and repeated keys — cutting tokens by up to 60%.
Reduce GPT token costs and Claude API costs. Fewer tokens per prompt means a smaller bill for structured payloads.
No account, no credit card, no limits. Convert unlimited JSON to TOON anytime in your browser.
No sign-up and no tracking. Conversions hit a stateless HTTPS endpoint, are processed in memory, and never stored or logged.
Convert JSON to TOON in well under a second, with immediate token-savings feedback.
Convert JSON to TOON for prompts, then back to JSON when needed — round-trips preserve every value.
Copy your JSON and paste it into the input pane. The converter supports all standard JSON.
Use json → toon to compress for LLM prompts, or toon → json to convert back.
Hit convert and watch your data transform into compact TOON with a live token-reduction estimate.
Click copy and drop the TOON straight into your GPT, Claude, or Gemini prompt.
TOON (Token-Oriented Object Notation) is a compact format designed for LLM inputs. It achieves up to 60% fewer tokens than JSON while staying lossless and deterministic.
Official implementations exist for TypeScript/JavaScript, Python, Rust, and Java. Install with npm install toon-format, or use our REST API. Source: github.com/toon-format/toon.
TOON (Token-Oriented Object Notation) is a compact data format designed for LLM inputs. It combines YAML-style indentation with CSV-like tabular layouts to eliminate the redundant brackets, braces, and repeated keys found in JSON, reducing token count by 30–60% while remaining lossless.
Both are readable and lossless, but TOON uses far fewer tokens for uniform arrays of objects because it writes each key only once and lays the values out in a compact tabular form. For data sent to LLMs where token cost matters, TOON is typically the better choice.
LLM APIs bill per token. Because TOON removes repeated keys and structural punctuation, the same data uses 30–60% fewer tokens, which directly lowers the cost of every prompt that contains structured data.
Yes. TOON reduces the number of tokens GPT models need to read for the same payload, lowering input token usage and cost without losing any data.
Typical reductions are 30–60%. Savings are highest for uniform arrays of objects (tabular data) and lower for deeply nested or highly irregular structures.
Yes. Conversion is fully bidirectional and lossless — JSON → TOON → JSON returns identical data. Use the toon → json toggle in the converter.
We require no account and store none of your conversions. Data is sent over HTTPS to a stateless conversion endpoint, processed in memory, and never logged or retained.
TOON handles any valid JSON. Token savings are largest for uniform arrays of objects; nested or irregular data still converts losslessly but with smaller reductions.
No. The web converter is free and needs no account. For programmatic access there is also a REST API and an official toon-format library for TypeScript, Python, Rust, and Java.
Yes. TOON is plain text with a simple, regular structure that GPT, Claude, and Gemini parse reliably. Including a short format description in your prompt makes results even more consistent.
Convert JSON to TOON for free in your browser, or grab an API key for programmatic access.