My Tool Studio
Developer

JSON to TOON Converter

This JSON to TOON converter rewrites JSON as TOON, Token-Oriented Object Notation, a compact format for putting structured data into LLM prompts. TOON drops most braces and quotes, and writes an array of similar objects as a table: the field names appear once in a header, then one row per item. Paste JSON, drop or upload a .json file or load one from a URL, pick a comma, tab or pipe delimiter, and press Convert to TOON. The panels below compare estimated tokens for minified JSON and TOON, and a small calculator turns the difference into cost at the price you enter. Swap direction converts TOON back to JSON. Teams sending product lists, logs or database rows to GPT, Claude or Gemini use it to see if TOON pays off for their data.

Always freeNo sign upRuns in your browser
Examples:
JSON → TOON
Output appears here...

How to use

01

Add JSON

Paste JSON into the JSON pane, drop or upload a .json file, use Load URL, or press one of the examples: a product table, log events or a nested config. Choose a comma, tab or pipe delimiter.

02

Convert and compare

Press Convert to TOON. The panels show estimated tokens for minified JSON and for TOON and the difference. Enter your model's price and a request count to estimate the cost change.

03

Copy, download or reverse

Press Copy or Download .toon. To go back, press Swap direction, which moves the TOON into the input, then press Convert to JSON to rebuild the original.

Why JSON to TOON Converter

JSON vs TOON: the sample side by side

The sample on this page holds a model name, a temperature and four products with the same five fields. In TOON the products become one header line, products[4]{id,sku,name,price,inStock}:, followed by four rows such as 1,SKU-1001,Wireless Mouse,24.99,true.

The table shows the character counts and the tool's token estimates for each version of that sample. Minified JSON is the fair baseline, since that is what you would send to a model if you cared about tokens.

On this sample TOON uses about a third fewer estimated tokens than minified JSON. Your own data can differ a lot, so paste a real payload to see its numbers. The tab delimiter makes almost no difference here because none of the values contain commas.

VersionCharactersEstimated tokens
JSON, pretty-printed (2 spaces)576228
JSON, minified360157
TOON, comma delimiter221103
TOON, tab delimiter222104

When not to use TOON

TOON helps most when a model reads many rows of the same shape. In other cases it adds a conversion step for little or no gain.

  • A program parses the result: APIs, function-calling arguments and tool outputs expect JSON.
  • The data is deeply nested or each item has different keys, so there are no tables to form.
  • The payload is small, so the saving is a handful of tokens.
  • Your model gives worse answers with TOON in your own tests. Check before switching a production prompt.
  • You edit or diff the data by hand often. Editors, linters and libraries widely support JSON, while TOON is newer and has far fewer tools, so keep JSON as the source and convert when you build the prompt.

Common questions

What is the TOON format?
TOON, short for Token-Oriented Object Notation, is a compact text format for LLM prompts. It uses indentation instead of braces and writes a uniform array of objects as a table with one header row, so repeated keys, brackets and most quotes disappear. It holds the same data as JSON.
How many tokens does TOON save compared with JSON?
It depends on the shape of your data. Arrays of objects with the same keys save the most, because each key is written once instead of once per row. Deeply nested or irregular data saves little and can even cost more, so check the estimate for your own payload.
How accurate is the token estimate on the TOON converter?
It is a heuristic that approximates GPT-style tokenizers, not a real tokenizer, and exact counts differ between models. Both formats are measured the same way, so the comparison between them is fair. For exact numbers, use your provider's tokenizer or token counting API.
Is JSON to TOON conversion lossless?
Yes. Strings, numbers, booleans, null, objects and arrays all survive the round trip. Press Swap direction and Convert to JSON to check that you get your original data back.
Do GPT and Claude understand TOON?
Models can usually read it, since it looks like a mix of YAML and CSV. Results vary by model and task, so say in the prompt that the data is in TOON format and test the answers on your own data before switching.
When should I keep using JSON instead of TOON?
Keep JSON when a program, not a model, reads the data, such as an API, a function-calling schema or a tool output. Also keep it for deeply nested, irregular data, where TOON's table layout does not apply.
Which TOON delimiter should I choose?
Comma is the default and the easiest to read. Tab can save a few tokens because tabs rarely appear in data, so fewer values need quotes. Pipe is a readable middle ground. The delimiter is declared in each array header, so conversion back to JSON works with any of them.
How does the TOON cost calculator work?
It multiplies the token difference between minified JSON and TOON by the number of requests and your price per million input tokens. It covers only the data you pasted, not the rest of your prompt or the output tokens. No prices are built in, so enter your model's current rate.
Can I convert TOON back to JSON?
Yes. Press Swap direction, paste or keep the TOON in the input, and press Convert to JSON. If the TOON is malformed, for example a row with the wrong number of values, an error explains the problem.
Which example data shows the biggest TOON savings?
Press Product table or Log events: both are lists of objects with the same keys, so TOON writes the keys once and saves a large share of tokens. Nested config is deliberately different. It has no repeated rows, so TOON saves very little there, which shows when it is not worth switching.

More Developer tools

View all