JSON to TOON converter

Paste JSON or TOON, or open a local file. Convert in either direction and compare text sizes; files and text stay in your browser.

Convert JSON and TOON v4.4 locally. JavaScript is required for conversion.

How it works

This converter implements the JSON-value syntax of TOON v4.4 (working draft, 2026-10-08). It uses two-space indentation, length headers, primitive arrays, mixed lists, uniform object tables, nested table columns and keyed tables. Full-line comments are accepted when decoding. Quoting and escape rules follow sections 7–12 of the official specification.

Each conversion checks that decoding its encoded TOON preserves the parsed value, ignoring object key order. Minified JSON, two-space pretty JSON and canonical TOON are compared without a trailing newline. Characters are Unicode code points. The approximate token count is characters ÷ 4, rounded up; this requested heuristic is not a tokenizer and does not predict actual savings or billing.

Numbers use JavaScript finite double precision; large integers and decimals may be rounded when parsed. Quote identifiers that require exact digits. Integer-like object keys follow JavaScript enumeration order. Prototype-related keys are preserved as ordinary own properties. JSON duplicate keys follow JSON.parse last-write behavior; duplicate TOON keys are rejected.

Worked examples

Uniform users from the specification

Two users with id, name and role become one header and two rows:

users[2]{id,name,role}:
  1,Ada,admin
  2,Bob,user

Decoding restores both objects and their three fields.

A primitive list

{"tags":["a","b","c"]} has 22 characters. TOON tags[3]: a,b,c has 14 characters. The TOON heuristic estimate is ceil(14 ÷ 4) = 4 tokens.

Frequently asked questions

Does TOON always use fewer tokens than JSON?
No. Uniform tables can avoid repeated keys, but nesting and mixed data can make TOON larger. The displayed estimate is only a four-characters-per-token heuristic; use the target model’s tokenizer for an actual count.
Which specification and fixture categories are supported?
TOON v4.4 JSON-value encoding and strict decoding, including keyed objects, nested tables and comments. All supplied fixture categories run. Only cases with strict:false are skipped: 54 non-strict cases across arrays-nested, arrays-primitive, arrays-tabular, blank-lines, comments, indentation-errors, objects, objects-keyed, root-form and validation-errors. Non-JSON host-type normalization and byte-input library APIs are outside scope.
How are delimiters handled?
Choose comma, tab or pipe for encoding. A tab or pipe is declared inside each length header. Decoding reads each header’s own delimiter, so nested arrays can use different delimiters. The output delimiter also controls the canonical TOON size comparison when decoding.
What are the input limits?
This tool limits input and generated text to 1,000,000 UTF-8 bytes and 10,000 lines, with nesting capped at 100 levels. These are browser resource safeguards, not TOON specification limits.
Are files uploaded or saved on a server?
No. Conversion, validation and downloads happen locally. Copy uses your browser clipboard. Local files must be valid UTF-8. Pasted text and files follow the same BOM policy: remove one leading U+FEFF before parsing. Any further U+FEFF is content in TOON; an extra BOM before a JSON value is invalid JSON.

Sources

Last reviewed 2026-11-14; next review due by 2027-02-12. The method is written out above so you can check our math.