What This Tool Does
This converter is bidirectional: paste JSON into the input box and it produces TOON (Token-Oriented Object Notation) output, or paste TOON and it produces the equivalent JSON. You don't need to tell it which direction to run - it auto-detects this by trying to parse your input as JSON first; if that fails, it falls back to parsing it as TOON. TOON exists to reduce the number of tokens used when sending structured JSON data to LLMs (in RAG pipelines, agent tool calls, and AI context windows) while staying easy for humans to read. See the official TOON spec for the full format definition.
How to Use It
- Paste your JSON (or TOON) into the Input box above.
- Click Run. The tool detects the input format automatically.
- Read the converted result from the Output box - JSON becomes TOON, and TOON becomes JSON.
- Copy the output for use in your LLM prompt, RAG pipeline, or application code.
- Click Clear to reset both boxes and start over.
TOON Syntax at a Glance
TOON has three core forms. All of them avoid the braces, brackets, and repeated quoting that make JSON token-heavy.
Nested objects - indentation, no braces
location:
city: Berlin
country: DE
Arrays of primitives - inline, comma-separated
tags[3]: red,green,blue
Arrays of uniform objects (tabular form) - the key token-saving feature
forecast[2]{day,temp,condition}:
Mon,-2,snow
Tue,1,cloudy
In the tabular form, the field names (day,temp,condition)
are declared once in the header instead of being repeated as JSON keys on every object, and
[2] records how many rows follow. Values that
contain a comma, a colon, or leading/trailing whitespace are automatically wrapped in double quotes so
they can't be confused with delimiters.
Before / After: An API Response
Here's a typical API response - a list of user records - shown as JSON and as the TOON it converts to. This is where the tabular array form saves the most tokens, since the four field names are written once instead of once per user.
JSON (before)
{
"users": [
{ "id": 1, "name": "Ada Lovelace", "role": "engineer", "active": true },
{ "id": 2, "name": "Grace Hopper", "role": "admin", "active": true },
{ "id": 3, "name": "Alan Turing", "role": "engineer", "active": false }
]
}
TOON (after)
users[3]{id,name,role,active}:
1,Ada Lovelace,engineer,true
2,Grace Hopper,admin,true
3,Alan Turing,engineer,false
The id, name,
role, and active
keys appear exactly once, no matter how many user rows follow.
Why Convert JSON to TOON?
Every JSON key you repeat across an array of objects costs tokens in an LLM prompt - and those tokens add up fast in RAG pipelines, agent tool-call payloads, and long context windows. TOON's tabular array form removes that repetition by declaring field names once. According to TOON's published benchmarks, this results in roughly 42.6% fewer tokens than equivalent JSON, while achieving comparable or better LLM retrieval accuracy (72.2% for TOON vs. 71.4% for JSON in their tests). In short: smaller prompts, lower cost, and no measurable loss in how well the model reads the data back. See the full write-up on the Docs page.
FAQ
Does this tool work in both directions?
Yes. Paste JSON to get TOON, or paste TOON to get JSON back. The tool auto-detects the direction by trying to parse your input as JSON first, then falling back to TOON parsing.
Is TOON valid JSON?
No. TOON is a distinct, indentation-based format - not a JSON dialect. It's designed to convert
to and from JSON losslessly, but a TOON document will not parse with JSON.parse().
Is my data uploaded anywhere?
No. Conversion happens entirely client-side in your browser. Nothing you paste here is sent to a server.
Where can I read the full spec?
The official TOON specification and reference implementation live at github.com/toon-format/toon. This site's own Docs page covers the full syntax with examples.
Why does TOON save tokens compared to JSON?
Because arrays of uniform objects list their field names once in a header row instead of repeating them as keys on every object, the way JSON does. That's the basis of TOON's published ~42.6% token reduction versus equivalent JSON.
Related Tools & Guides
- TOON Format Documentation - the full syntax reference
- Introducing TOON
- Getting Started with TOON
- Performance Benefits of TOON
- TOON Design Principles