JSON to TOON Converter
What is TOON Format?
What is TOON Format?
TOON (Token-Oriented Object Notation) is a compact, lossless encoding of the JSON data model, built by the toonformat.dev project. It combines YAML-style indentation for nested objects with CSV-style tabular rows for arrays of uniform objects.
TOON is meant as a drop-in representation of existing JSON for LLM prompts: keep using JSON in your code, and encode it as TOON only when sending it to a model, to reduce the token count the model is charged for. Its biggest savings come from arrays of same-shaped objects (e.g. rows from a database or API list); for deeply nested or non-uniform data, plain JSON can still be just as efficient.
- Tabular Arrays: Uniform object arrays become compact comma-delimited rows
- Lossless: Round-trips back to the exact original JSON
- Token Savings: Fewer tokens billed per request for tabular data
- LLM-Friendly: Explicit array lengths and headers help models parse reliably
When to Use JSON to TOON
- LLM Prompt Compression: Cut token costs before sending list-shaped data to GPT-4/Claude/Gemini
- API Response Encoding: Compress uniform API list responses for model input
- Batch Data for AI: Send rows of records (users, products, logs) more cheaply
- Round-Trip Testing: Verify TOON output decodes back to the same JSON
How to Use
- Paste your JSON data into the input field
- Click "Convert to TOON" to encode it
- Compare the TOON output length against the original JSON
- Copy the TOON output for use in your LLM prompt
💡 Pro Tips
- Token savings are largest for arrays of objects that all share the same fields
- Deeply nested or non-uniform JSON may not shrink much — that's expected per the spec
- Use the Token Counter tool to measure the actual token difference for your model
- Use TOON to JSON to verify the conversion round-trips losslessly
TOON & Tokenization Glossary
- TOON
- Token-Oriented Object Notation - a compact, lossless JSON encoding that uses tabular rows for uniform arrays to reduce LLM token counts.
- Token
- A fundamental unit of text that LLMs process and are billed by, typically a word, number, punctuation mark, or part of a word.
- Uniform Array
- An array where every object shares the same set of fields — the case TOON compresses best via tabular rows.
- Lossless Round-Trip
- Encoding data to TOON and decoding it back produces the exact original JSON, with no data loss.
- LLM (Large Language Model)
- AI models like GPT and Claude that process text as tokens and charge based on token count for API usage.
- JSON Schema
- The structure and organization of JSON data, including field types, nesting, and relationships.