Using it
Paste JSON and the TOON appears beside it, with the character counts in the steps. The Delimiter setting picks what separates values in table rows: comma, tab or pipe. Swap the boxes to turn TOON back into JSON; the decoder is strict, so a table with the wrong number of rows or cells is reported rather than guessed at.
Nothing you paste leaves your browser. The conversion uses @toon-format/toon, the format's own reference library, which follows version 4.1 of the specification.
What TOON is
TOON, short for Token-Oriented Object Notation, is a text format for the same data JSON holds, designed by Johann Schopplich for putting data into prompts for large language models, where every token costs. Objects are written as indented key: value lines, with no braces and few quotes. Arrays state their length in square brackets, and an array of objects that all have the same keys becomes a table: the field names once in the header, then one row per object.
So the sample's three users, which JSON writes as three objects each repeating id, name and role, become users[3]{id,name,role}: followed by three short rows.
The same data, two ways
| JSON | TOON |
|---|---|
| {"users": [{"id": 1, "name": "Ada"}, {"id": 2, "name": "Bob"}]} | users[2]{id,name}: / 1,Ada / 2,Bob |
| {"tags": ["a", "b", "c"]} | tags[3]: a,b,c |
| {"server": {"port": 8080}} | server: / port: 8080 (indented) |
When it saves tokens, and when it doesn't
The saving comes from writing the keys once. Long lists of records with the same fields, such as rows from a database or results from an API, shrink the most. The specification itself says JSON may be more compact for data that is deeply nested or irregular, and that plain CSV is usually smaller still for a flat table with no nesting.
The way to know for your own data is to measure it. The token counter's Token cost by format option writes the same JSON as indented and minified JSON, YAML, CSV, TOON and XML, and counts each with OpenAI's tokenizers.
Questions
Is TOON a replacement for JSON?
No. It's meant as a layer for prompts: keep JSON in your code and APIs, and convert to TOON just before the data goes to a model.
Do models understand TOON?
It's designed to be easy to read, and the explicit lengths and field names help a model follow the structure, but test with your own model and data before relying on it.
What does the number in brackets mean?
The array's length. users[3] promises three entries, which lets a decoder, or a model, notice if any were lost.
Sources
- TOON specification, version 4.1 (toon-format/spec)
- toon-format/toon: the reference TypeScript library (MIT)
Added . What's new






