JSON to TOON Converter Online — Free
Convert JSON to TOON (Token-Oriented Object Notation) — a compact format that cuts LLM prompt tokens by up to 40%.
Frequently Asked Questions
What is TOON?
TOON (Token-Oriented Object Notation) is a compact, lossless re-encoding of the JSON data model designed for LLM prompts. It combines YAML-style indentation for nested objects with CSV-style rows for uniform arrays, so the same data costs noticeably fewer tokens.
How many tokens does TOON actually save?
It depends on the shape of your data. Uniform arrays of objects — the same fields repeated across many rows — benefit most, since each field name is written once in a header instead of on every record. Deeply nested, non-uniform data saves far less, and can occasionally be larger than JSON.
Is the conversion lossless?
Yes. TOON encodes the JSON data model, so any valid JSON round-trips back to equivalent JSON through the TOON to JSON converter.
Does my data get uploaded anywhere?
No. The conversion runs entirely in your browser — nothing is sent to a server.
Privacy First: All processing happens directly in your browser. Your data never leaves your device.
About JSON → TOON
TOON — Token-Oriented Object Notation — is a compact re-encoding of the JSON data model built for LLM prompts. On uniform, tabular data it costs meaningfully fewer tokens than JSON while remaining human-readable and losslessly convertible.
Where the savings come from
JSON repeats every key on every record. In an array of a thousand objects, the field names are transmitted a thousand times, and each one costs tokens in a model context window. TOON writes the field names once in a header and then emits rows, in the manner of CSV, while keeping the explicit structure that makes the data unambiguous.
The bracketed length and the braced field list are not decoration. They give the model a declared row count and column set to check its reading against, which is why TOON tends to hold or improve extraction accuracy rather than trading correctness for size.
{ "users": [
{ "id": 1, "name": "Alice", "role": "admin" },
{ "id": 2, "name": "Bob", "role": "user" }
] }
users[2]{id,name,role}:
1,Alice,admin
2,Bob,userWhen TOON is the wrong choice
The savings are entirely a function of shape, and honesty about this matters more than the headline number. Uniform arrays of flat objects benefit most. Deeply nested, non-uniform structures fall back to an indented list form that saves little — and measured against minified JSON rather than pretty-printed JSON, such a document can come out slightly larger than where it started.
A useful rule: if your data would look natural as a spreadsheet, TOON will compress it well. If it looks like a configuration file, the gain will be small.
Practical notes
- The conversion is lossless with respect to the JSON data model — anything encoded here decodes back to equivalent JSON.
- Comparisons against pretty-printed JSON overstate the benefit, because much of what is removed is indentation you would not have sent to a model anyway. Compare against minified JSON.
- Token counts vary by tokenizer, so measure with the one your target model actually uses rather than trusting a character-count ratio.
- TOON is for data you put into a prompt. It is not a storage or interchange format, and nothing downstream of your prompt should expect it.