JSON to TOON Converter

Convert JSON to TOON (Token-Oriented Object Notation), a compact format that sends the same data to ChatGPT, Claude or Gemini with fewer tokens. See how many characters and tokens you save. Runs in your browser, so your data is never uploaded.

JSON Input

Ln 1, Col 1Empty

TOON

Your result will appear here.
No result yet

What Is TOON?

TOON (Token-Oriented Object Notation) is an open, human-readable format for the same data that JSON holds: objects, arrays, strings, numbers, booleans and null. It was made for prompts to large language models (LLMs). LLM APIs charge per token and have a limited context window, and JSON spends many tokens on repeated keys, quotes and braces. TOON writes the keys of a list of objects only once, like a table header, and leaves out most quotes and brackets.

The result is usually much smaller for lists of similar records, such as products, users, orders or log rows, and the data stays exactly the same: converting it back with TOON to JSON gives equal JSON.

How to Convert JSON to TOON

  1. Paste your JSON, drop a .json file on the box, or load it from a link with URL.
  2. Pick a delimiter: comma (the default), tab or pipe.
  3. Click Convert to TOON, or press Ctrl + Enter.
  4. Read how much smaller the TOON is, then copy it into your prompt or download it.

Example

JSON
{
  "users": [
    { "id": 1, "name": "Emily Clark", "role": "admin", "active": true },
    { "id": 2, "name": "James Smith", "role": "editor", "active": false },
    { "id": 3, "name": "Olivia Brown", "role": "viewer", "active": true }
  ]
}
TOON (115 characters)
users[3]{id,name,role,active}:
  1,Emily Clark,admin,true
  2,James Smith,editor,false
  3,Olivia Brown,viewer,true

users[3] says the list has 3 items, and {id,name,role,active} names the fields once. Each line below is one record. Here TOON is 115 characters, 65% smaller than the same JSON formatted with 2 spaces (326 characters) and 40% smaller than minified JSON (192 characters).

How JSON Becomes TOON

JSONTOON
ObjectIndented key: value lines, like YAML
Array of objects with the same keysA table: items[2]{sku,qty,price}: and one row per item
Array of simple valuesOne line: tags[2]: gift,express
Array of mixed items, or objects with different keysA list with - in front of each item
StringsWithout quotes when that is safe; quoted when they contain the delimiter or a colon, are empty, or look like a number or true (e.g. "007")
Numbers, true, false, nullThe same values

A Nested Example

TOON
order:
  id: A-100
  customer:
    name: Emily
    city: London
  tags[2]: gift,express
  items[2]{sku,qty,price}:
    K-1,2,49.99
    M-7,1,19.5

When Should You Use TOON?

  • Good fit: sending tables of records to an LLM, such as search results, product lists, rows from a database or analytics data. The more rows with the same keys, the bigger the saving.
  • Smaller gain: deeply nested data where every object has different keys. TOON still works, but it can be close to minified JSON in size.
  • Keep JSON for: APIs, config files and anything another program reads. TOON is meant for LLM input, not as a replacement for JSON everywhere.

Tips

  • Delimiter: if your values contain many commas (addresses, sentences), choose tab or pipe so fewer values need quotes.
  • Token counts shown here are an estimate (about 4 characters per token). The real number depends on the model's tokenizer.
  • In code: the official JavaScript library is npm install @toon-format/toon, then encode(data) and decode(text).
  • Broken JSON? Trailing commas and single quotes are repaired automatically. For anything else, use JSON Repair.
  • Want a table for people instead of a model? Try JSON to Markdown Table or JSON to CSV.

Frequently Asked Questions

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, readable format for the same data as JSON. It lists the keys of an array of objects once, like a table header, so the data uses fewer tokens when you send it to an LLM such as ChatGPT, Claude or Gemini.

How much smaller is TOON than JSON?

It depends on the data. For lists of records with the same keys it is often 30 to 60 percent smaller than formatted JSON. For deeply nested data with different keys the saving is smaller. The tool shows the exact character count and an estimated token count for your JSON.

Can I convert TOON back to JSON?

Yes. Use the TOON to JSON converter. TOON keeps every value and type, so converting back gives the same JSON data.

Is my JSON uploaded?

No. The conversion runs in your browser and your data never leaves your device.

Related Tools