Skip to the tool
GigaJSON

JSON to TOON

All tools
Format and check
View and query
Convert
JSON to code
Encode and decode
Sample files
Guides Open GigaJSON

Convert JSON to Token-Oriented Object Notation (TOON), a text format that writes repeated field names once in arrays of similar records. Paste JSON or open a file, then copy or download the TOON. The converter keeps every JSON value and checks the result by decoding it back. To choose fields or rows first, use the JSON Token Counter.

How to use it

  1. Paste valid JSON, open a file up to 2 MiB, or load the example.
  2. TOON appears automatically. Compare its token count with your original JSON.
  3. Review the output, then copy it or download converted.toon.

Read more: What is the TOON format? Syntax and examples · JSON vs TOON: token counts measured on six kinds of data · How to reduce JSON tokens for AI prompts

Private, local processing

This tool runs in your browser, in a background worker: nothing you paste or open is uploaded, and nothing is kept after you leave. This tool accepts up to 2 MiB of JSON and 64 levels of nesting. Filter larger files in the workspace first. Already loaded features keep working if your connection drops. Loading another tool or jq for the first time needs a connection. When one tool isn't enough, GigaJSON opens your data with a tree, a table, JSONPath/JMESPath/jq queries, transforms, diff and history.

When TOON saves tokens

We counted 100 records of six kinds of sample data with o200k_base. TOON was much smaller when every record fits one row, and larger than compact JSON when each record has a list field such as tags. The full measurement shows why.

100 records ofCompact JSONTOONTOON vs compact
Users (nested objects, no lists)10,3646,49937% fewer
Log events (nested objects, no lists)7,8735,37532% fewer
Products without tags8,8755,12142% fewer
Products with a tags list9,52211,89525% more
Orders (items and tags lists)18,57819,3544% more

Questions

What is TOON?

Token-Oriented Object Notation, a readable text form of JSON data. For an array of objects with the same fields, it writes the field names once and then one row of values per object. It handles nested objects and the other JSON structures too.

What does the TOON format look like?

For a list of records, a header line gives the list's name, its length and the field names once, then each record is one indented row of values. {"users": [{"id": 1, "name": "Ada"}, {"id": 2, "name": "Linus"}]} becomes users[2]{id,name}: followed by the rows 1,Ada and 2,Linus. Single objects are written as key: value lines with indentation, much like YAML.

Does this converter remove or change values?

It keeps every field and row. The converter decodes its own output and checks that you'd get the same JSON values back. It refuses duplicate object keys, numbers it can't represent exactly, and any conversion that fails that check. Whitespace and the way numbers are written can change.

Does TOON always use fewer tokens?

No. Repeated records usually shrink, but other structures can come out smaller as compact JSON. The counts come from o200k_base on the actual text; other tokenizers and full API requests will differ. And fewer tokens won't guarantee better AI answers.

Can I use TOON anywhere I use JSON?

No, its syntax differs. Use it as readable data in a prompt where your workflow accepts it; an API or parser that expects JSON still needs JSON. This tool doesn't call an AI model.

How large can the input be?

Up to 2 MiB of JSON and 64 levels of nesting. For larger documents, use the GigaJSON workspace to select a smaller result first.

Is my data uploaded?

No. The tool runs in your browser, in a background worker. Nothing you paste or open goes to a server, and nothing is kept after you leave the page.

All tools