JSON to TOON Converter
Convert JSON to TOON (Token-Oriented Object Notation) - A token-efficient format for LLMs
Input
Output
Paste your JSON on the left and the TOON shows up here.
Or drop a file on this box, , or .
What is JSON to TOON Converter?
TOON (Token-Oriented Object Notation) is a compact text format for handing structured data to an LLM. Where JSON repeats every key on every object, TOON writes an array of same-shaped objects once as a header, users[3]{id,name,role}:, followed by one comma-separated row per item. Paste JSON on the left and this page writes the TOON for you.
That's where the savings come from, so they depend on your data. A list of 200 orders with the same fields shrinks a lot; deeply nested or irregular objects save little and can even come out longer than minified JSON. The TOON spec and README has benchmarks if you want numbers for your model. Paste your own data, compare, and decide. Learn more about JSON at MDN.
The encoder is the TOON project's own library loaded into the page, so the conversion happens locally. If your input refuses to parse, tidy it with the JSON Formatter or let the JSON Validator point at the bad line first.
What Makes This Tool Different
Token Savings
Uniform arrays of objects lose their repeated keys, braces and most quotes, which is usually where JSON spends its tokens. Check the result against your own data and tokenizer.
Lossless Conversion
Objects, arrays, strings, numbers, booleans and null all map to TOON, and decoding the output gives back the same values. Integers longer than JavaScript can hold exactly, like a 19-digit ICCID, are written with every digit.
Local Processing
Conversion happens in milliseconds. Paste your JSON, and get optimized TOON. No waiting, no server delays – pure browser-side processing.
Smart Formatting
TOON uses intelligent formatting – tabular data becomes compact rows, nested structures use indentation, and arrays are optimized for readability.
File Upload Support
Got a JSON file? Just upload it. Works with .json and .txt files. No need to copy-paste – just drag and drop or click upload.
Download TOON
One click to download your converted TOON as a .toon file. Perfect for saving, sharing, or using with LLM applications.
How It Works
Paste or Upload JSON
Paste JSON into the left editor or load a .json or .txt with "Upload", which reindents the file with two spaces before converting and rejects one that does not parse. "Sample" loads three users with id, name and role, which is the shape where TOON saves the most.
Automatic Conversion
The right panel refreshes a moment after your last keystroke. The sample turns into users[3]{id,name,role}: with three indented rows such as 1,Ava Chen,admin. Strings a reader could mistake for something else, like a time written "06:00", stay quoted.
Copy or Download
Use "Copy" to paste the TOON somewhere else, or "Download" for a .toon file on disk. The TOON format is optimized for LLM token efficiency while remaining human-readable.
When You'd Actually Use This
LLM Applications
Working with Large Language Models? Convert a JSON list of records to TOON before pasting it into a prompt, and the repeated keys are written once instead of on every row, which usually cuts the token count.
API Responses
Sending data to LLMs via APIs? TOON format reduces payload size and token costs. Perfect for optimizing API responses before sending to ChatGPT, Claude, or other LLMs.
Database Records
Exporting database records for LLM processing? TOON's tabular format is perfect for uniform record sets. Convert JSON exports to TOON for efficient LLM consumption.
Time-Series Data
Working with analytics, metrics, or logs? TOON's compact format is ideal for time-series data with consistent fields. Reduce token costs when processing large datasets with LLMs.
Common Questions
Is my JSON data stored?
No. The encoding is done by the @toon-format/toon package inside the page itself; your JSON is neither saved nor uploaded. Want the same conversion in a build step? The package is published on npm and works in Node.js.
What JSON formats are supported?
We support all valid JSON according to the ECMA-404 standard. Objects, arrays, nested structures, strings, numbers, booleans, null – everything standard JSON supports.
Can I convert invalid JSON?
No. The converter validates your JSON first. If it's invalid, you'll see an error message. Fix the syntax error, then convert again. Use our JSON Validator to check your JSON first.
Is the conversion lossless?
For values, yes: every string, number, boolean, null, object and array comes back the same when you decode the TOON. Long integers keep all their digits. What changes is spelling, not data: 1.0 is written as 1, and the indentation is TOON's own.
How much token savings can I expect?
It depends on the shape. Tabular data (lists of objects with the same keys) sees the biggest drop, because keys appear once in the header. Deeply nested or non-uniform data saves much less and can be larger than compact JSON. The TOON spec and README publishes benchmarks; for your case, run both versions through your model's tokenizer.
Can LLMs understand TOON format?
Yes! TOON is designed to be LLM-friendly. Modern LLMs like GPT-4, Claude, and others can parse and understand TOON format just as well as JSON, but with significantly fewer tokens.
Other TOON Tools You Might Need
Already holding TOON and need it back as JSON, or want to check a TOON file someone sent you? These pages cover the reverse trip and the other formats: