JSON to TOON Converter

Convert JSON to TOON and back in your browser. TOON packs the same data into fewer prompt tokens.

Your JSON or TOON is converted locally in your browser and never uploaded, but avoid pasting secrets or production data into any online tool.

Need to tidy the JSON first? Try the JSON Formatter.

About JSON to TOON

TOON, short for Token-Oriented Object Notation, is a compact way to write JSON that uses far fewer tokens in an LLM prompt. Instead of repeating every key on every record, it folds an array of objects into a single tabular block with one header row and comma-separated values underneath. This JSON to TOON converter encodes any JSON document into TOON, shows you roughly how much smaller the result is than minified JSON, and converts TOON back to pretty-printed JSON when you switch direction. It is handy whenever you paste structured data into a model, build few-shot examples, or want to trim context windows without dropping information. Everything runs in your browser, so the data you paste is processed on your device and is never uploaded.

Features

How to use the JSON to TOON

  1. Keep the toggle on JSON → TOON and paste your JSON into the left pane.
  2. Read the TOON output on the right and check the savings estimate above it.
  3. Switch the toggle to TOON → JSON to decode a TOON string back to JSON.
  4. Copy the result or download it as data.toon or data.json.

Example

Input

{
  "users": [
    { "id": 1, "name": "Ada", "role": "admin" },
    { "id": 2, "name": "Alan", "role": "author" }
  ]
}

Output

users[2]{id,name,role}:
  1,Ada,admin
  2,Alan,author

An array of objects becomes one tabular TOON block with a single header row.

Common errors & troubleshooting

Frequently asked questions

What is TOON?
TOON (Token-Oriented Object Notation) is a compact, indentation-based encoding of JSON designed to use fewer tokens in LLM prompts. It expresses arrays of objects as a tabular block, a header row listing the field names followed by comma-separated value rows, instead of repeating keys on every record.
How much smaller is TOON than JSON?
It depends on the shape of the data. Arrays of many uniform objects shrink the most because each key is written once in the header rather than on every row; this converter shows a per-document character estimate so you can see the actual reduction for your input.
Is converting JSON to TOON lossless?
Yes. TOON encodes the same data as the source JSON, so this tool round-trips it: convert JSON to TOON and back and you get the original value. The TOON → JSON direction re-emits standard, pretty-printed JSON.
When should I use TOON instead of JSON?
Reach for TOON when you are feeding structured data into a language model and want to fit more into the context window, build few-shot examples, or cut prompt cost. For storage, APIs, and config you will usually still want plain JSON.
Is my data sent to a server when I convert it?
No. The JSON to TOON conversion runs entirely in your browser, so the data you paste is encoded on your device and never uploaded.

Related tools

All ArrayKit tools