Skip to main content

JSON ↔ TOON Converter

Convert JSON to TOON and back for compact LLM prompts

JSON Input

Options

Direction
Delimiter
Indent

TOON Output

Paste JSON or load an example.

Bundled version: TOON spec v4.1 · @toon-format/toon 4.1.1

How to use

  1. 1.Choose JSON → TOON or TOON → JSON.
  2. 2.Paste data, open a .json or .toon file, or load an example.
  3. 3.Adjust the delimiter, indent or strict parsing.
  4. 4.Check the representation size, then copy or download the output.
  5. 5.Select Verify round trip to confirm that JSON → TOON → JSON returns identical data.

About the JSON ↔ TOON Converter

TOON (Token-Oriented Object Notation) encodes the JSON data model with indentation, declared array lengths and tabular rows, so payloads for language models need fewer characters. This converter uses the official @toon-format/toon library in your browser to turn JSON into TOON and TOON back into JSON, and shows the bundled spec version.

When TOON saves the most

TOON is most compact for uniform arrays of objects, where field names are declared once and each element becomes one row. Deeply nested or irregular data falls back to list form and saves less; compact JSON can even be smaller. Sizes shown are bytes and characters; optional token counts use one named tokenizer and differ across models.

Limits

Input is limited to 2,000,000 characters and 256 nesting levels. Integers beyond the JavaScript safe range lose precision when JSON is parsed. Dotted key folding is not offered by the bundled library version. TOON is a working draft; output follows the bundled spec version shown in the tool.

Frequently asked questions
Is TOON always smaller than JSON?
No. TOON saves the most on uniform arrays of objects, where field names are declared once and each element becomes one row. Deeply nested or irregular data falls back to list form and can be close to, or even larger than, minified JSON. The converter shows the size change against both your input and minified JSON.
Does the converter count tokens?
The main statistics are bytes and characters because token counts depend on the tokenizer. An optional button counts tokens with the o200k_base tokenizer on the raw text; other models count differently, so treat it as one reference point.
How does Verify round trip work?
It encodes the current JSON data to TOON with your delimiter and indent, decodes that TOON with strict parsing and deep-compares the result with the original data. A mismatch reports the first differing path, such as $.users[1].name.

CodingTool is officially live on