JSON → TOON Converter
When you send structured data to a large language model, you pay per token — and JSON is expensive. Braces, brackets, quotes and repeated keys all consume tokens without adding meaning. TOON (Token-Optimized Object Notation) expresses the same data with far less punctuation, so the model receives the same information for fewer tokens.
The converter shows the TOON output alongside an estimate of the tokens and cost saved for popular models, so you can decide whether it is worth using in your prompts.
How to use
- Paste your JSON into the left panel, or click Sample to load an example.
- Click Convert to TOON. The compact output appears on the right.
- Review the cost table to compare estimated token counts and cost against formatted JSON.
- Copy the result or click Save to download it as a .toon file.
How the conversion works
- null becomes ~, true becomes T and false becomes F.
- Object braces { } are removed; nesting is expressed through indentation.
- Array items are prefixed with * instead of being wrapped in [ ].
- Quotes are dropped wherever the value is unambiguous.
When to use it
TOON works best for large, repetitive payloads such as lists of records, search results or database rows included as context in a prompt. For very small objects the savings are minimal, and if you need the model to return valid JSON you should still ask for JSON output.
Frequently asked questions
- Will the model understand TOON?
- Modern LLMs read indentation-based formats such as YAML and TOON reliably. Adding a one-line explanation of the notation to your prompt helps for the more compact symbols like ~, T and F.
- How accurate are the token estimates?
- They are approximations based on typical tokenizer behaviour (roughly four characters per token). Exact counts vary by model and tokenizer.
Privacy
This tool runs entirely in your browser. The data you paste or open is processed locally and is never uploaded to or stored on our servers.