Tools
EN

JSON to TOON Converter

TOON (Token-Oriented Object Notation) carries the same data as JSON with far fewer tokens, which makes LLM prompts cheaper and leaves more room in the context window. Paste JSON to convert it and see the estimated savings – or turn TOON back into JSON.

JSON

TOON

Private: your data is processed in your browser and never uploaded.

How to convert JSON to TOON

  1. Paste JSON or open a file. The TOON output and an estimate of the tokens saved appear immediately.
  2. Choose the delimiter: comma (default), tab or pipe. Tabs often need even fewer tokens.
  3. Copy the TOON into your prompt. To read a model's TOON answer, switch the direction to TOON → JSON.

TOON vs JSON: an example

The same two users in JSON:

{"users":[{"id":1,"name":"Ada","role":"admin"},{"id":2,"name":"Bob","role":"user"}]}

and in TOON:

The field names are written once in the header instead of once per object, and the quotes, braces and most punctuation disappear. For uniform arrays of objects – database rows, logs, search results, product lists – the savings are large: in our test with 100 customer records, TOON needed about 65% fewer tokens than formatted JSON and 47% fewer than minified JSON. The [2] length marker also lets the model and the decoder check that no row is missing.

TOON format in brief

DataTOON
Object fieldname: Ada
Nested objectaddress: followed by indented fields
Array of plain valuestags[3]: red,green,blue
Array of objects with the same keysusers[2]{id,name}: followed by one row per object
Mixed or nested arraysitems[2]: followed by - list items
Stringsunquoted, unless they contain the delimiter, a colon, quotes or brackets, have spaces at the ends or look like a number, true, false or null

When JSON is still the better choice

Token counts are estimated as characters ÷ 4. Exact numbers depend on your model's tokenizer, but the relative difference is a good guide.

Frequently asked questions

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of the JSON data model designed for LLM prompts. It combines YAML-style indentation for objects with CSV-style rows for uniform arrays.

Is TOON better than JSON?

For sending tabular or uniform data to a language model, usually yes: fewer tokens and explicit array lengths. For APIs, storage and deeply nested data, JSON remains the better choice.

How are the tokens estimated?

The tool divides the number of characters by four, a common rule of thumb for English text and code. The exact count depends on the tokenizer of your model.

Can I convert TOON back to JSON?

Yes. Switch the direction to TOON → JSON; the decoder checks the declared array lengths and reports the line of any problem.