JSON to TOON Converter

Input JSON(auto)

Output TOON

Your TOON appears here as you type.

users[3]{id,name,role}:
  1,Alice,admin
  2,Bob,user
  3,Cleo,user
Field names once, then one row per record.

Paste data to see token savings

What is a JSON to TOON converter?

TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of the JSON data model: it declares field names once and writes uniform arrays as rows, so the same data costs fewer tokens in an LLM prompt. json2toon.co turns JSON, CSV, YAML, XML and TOML into TOON or TONL, and back again. The data model stays the same; only the repeated syntax goes.

TOON uses about 43% fewer tokens than JSON on average (42.6% in the official TOON v4.1 benchmark), which lowers API costs for ChatGPT, Claude, Gemini, and similar models. It stays readable, unlike minified JSON. The converter shows the real token count for your own data, so you can check before you switch. Read the cost optimization guide or compare JSON vs TOON and TOON vs TONL.

Everything runs client-side: nothing you paste is uploaded, and share links keep the data in the URL fragment, which browsers never send to a server. Convert many files at once with batch mode (ZIP export), automate it with the free TOON API or the TypeScript library, or convert selected text on any page with the TOON Chrome extension. Common uses: LLM optimization, chatbot and RAG pipelines, data analysis.

users.toon−63% 61 tokens
[4]{id,name,email,role,active}:
  1,Alice,alice@example.com,admin,true
  2,Bob,bob@example.com,user,true
  3,Cleo,cleo@example.com,user,false
  4,Dev,dev@example.com,editor,true
users.json163 tokens
[
  {
    "id": 1,
    "name": "Alice",
    "email": "alice@example.com",
    "role": "admin",
    "active": true
  },
  {
    "id": 2,
    "name": "Bob",
    "email": "bob@example.com",
    "role": "user",
    "active": true
  },
  {
    "id": 3,
    "name": "Cleo",
    "email": "cleo@example.com",
    "role": "user",
    "active": false
  },
  {
    "id": 4,
    "name": "Dev",
    "email": "dev@example.com",
    "role": "editor",
    "active": true
  }
]
The same four records. TOON declares the field names once, then writes one row per record. Counted with o200k (GPT-4o, GPT-5).

How to convert JSON to TOON

  1. Paste your data

    Paste JSON, CSV, YAML or XML into the input editor, drop a file, or upload one. JSON, CSV and XML are detected automatically.

  2. Read the token count

    The output appears as you type. The bar under the editors shows input and output tokens, counted with a real GPT tokenizer.

  3. Copy and use it

    Copy the result into ChatGPT, Claude or your own prompt. Ctrl/⌘ + Shift + C copies without reaching for the mouse.

JSON vs TOON: quick comparison for LLM workflows

TOON and TONL are most useful when you need compact, readable structured data for prompts, evaluations, and context packing. JSON remains the default for general-purpose interchange.

CriteriaJSONTOON / TONL
Best fitGeneral API interchange and broad tool compatibilityLLM prompts, context packing, and compact structured data
Syntax overheadRepeated keys, quotes, braces, and brackets in every objectField lists and line-oriented syntax reduce repeated structure
Token efficiencyBaseline for structured payloadsAbout 43% fewer tokens on average (about 33-59% depending on data shape)
Readability at scaleFamiliar, but verbose on large arrays and nested objectsCompact while staying readable for tables and repeated records

Token savings vary by input shape. Arrays of similar objects and repeated keys usually benefit the most.

Frequently asked questions about JSON to TOON conversion

What is a JSON to TOON converter?

A JSON to TOON converter rewrites structured data into TOON or TONL, compact text formats designed for LLM workflows. The goal is to preserve the same data while reducing repeated syntax so prompts are smaller, easier to scan, and cheaper to send.

How much token reduction can TOON or TONL provide?

Token savings depend on the shape of the input. Arrays of similar objects and payloads with repeated keys usually compress best. In the official TOON v4.1 benchmark, TOON used 42.6% fewer tokens than JSON on average, from about 33% on mixed or nested structures to about 59% on flat uniform tables.

Does json2toon.co upload my data to a server?

No. The main web converter runs client-side in the browser, so your source data stays on your device during conversion. That makes it useful for privacy-sensitive payloads and quick experiments where you do not want to send raw data to a third party.

Which formats can I convert to TOON or TONL?

json2toon.co supports JSON, CSV, YAML, XML, and TOML inputs alongside TOON and TONL. You can use it to compare representations, convert existing payloads, and pick the format that fits your prompt, RAG, or configuration workflow.

Explore more