What is the JSON to TOON Converter?
This tool converts between JSON and TOON, a compact token-oriented notation designed to represent the same data in noticeably fewer tokens when passed to a language model.
When JSON is sent to a language model, its structural characters have a real cost. Every brace, bracket, quote, and colon consumes tokens, and in an array of uniform objects every key is repeated for every element. For a list of a hundred records, that repetition dominates the payload.
TOON addresses this by declaring the field names once as a header and then listing only the values for each record, in the manner of a CSV but retaining the ability to nest. The data is unchanged; only its representation is more economical.
The saving is largest exactly where it matters most: uniform arrays of objects, which is the shape of most data anyone passes to a model. For deeply nested or highly irregular structures the advantage narrows, and plain JSON may remain the better choice.
How to use the JSON to TOON Converter
- Paste your JSON. Arrays of objects with consistent fields benefit most.
- Convert to TOON. The equivalent compact representation is produced.
- Check the token comparison. See how many tokens each representation uses.
- Convert back when needed. TOON converts back to JSON without loss, so you can move in either direction.
Worked examples
A uniform array of objects
The field names appear once in the header rather than being repeated for every record.
{
"users": [
{ "id": 1, "name": "Ada", "role": "admin" },
{ "id": 2, "name": "Alan", "role": "user" },
{ "id": 3, "name": "Grace", "role": "admin" }
]
}users[3]{id,name,role}:
1,Ada,admin
2,Alan,user
3,Grace,adminThe keys id, name, and role appear once instead of three times each. The saving grows linearly with the number of records.
Common use cases
- Reducing prompt size. Fitting more data into a fixed context window by spending fewer tokens on structure.
- Lowering API cost. Token-based pricing means a smaller representation of the same data costs less per request.
- Passing tabular data to a model. Query results and record sets are exactly the uniform shape TOON handles best.
- Comparing representations. Measuring the token cost of a payload before committing to a format.
Features and limitations
- Converts in both directions between JSON and TOON without data loss.
- Shows a token count comparison between the two representations.
- Handles nested structures as well as flat arrays.
- Savings are greatest for uniform arrays of objects and smaller for irregular or deeply nested data.
- TOON is a newer format, so a model may need a brief explanation of the notation in your prompt, though the token saving usually still comes out ahead.
Frequently asked questions
What is TOON?
A token-oriented notation that encodes the same data as JSON using fewer tokens, by declaring field names once for a collection instead of repeating them in every record.
How much does it actually save?
It depends heavily on shape. Uniform arrays of objects can see substantial reductions, since key repetition is eliminated. Deeply nested or irregular data saves much less, and occasionally nothing worth the added unfamiliarity.
Is the conversion lossless?
Yes. The same data round-trips back to equivalent JSON, so you can convert in either direction without losing information.
Will a language model understand TOON?
Models generally handle it well, particularly when the prompt briefly explains the format. Because it resembles CSV with a header, the structure is fairly self-evident.
Should I use TOON instead of JSON generally?
No. JSON remains the right choice for APIs, configuration, and storage, where tooling support and universal familiarity matter far more than token count. TOON is specifically for the model-prompt case.
Is my data sent anywhere?
No. Conversion happens in your browser, so the data you are preparing for a prompt is not transmitted by this tool.
All processing happens locally in your browser, your data never leaves your device.
