DT Dev Tools

TOON to JSON

Convert TOON (Token-Oriented Object Notation) to JSON online. Decode LLM output with strict length validation, pretty or minified. Free, private, in your browser.

πŸ”’ Runs entirely in your browser β€” nothing is uploaded

Advertisement

Decode TOON back to JSON

TOON β€” Token-Oriented Object Notation β€” is a compact text format for the JSON data model built to save tokens when you pass structured data to large language models. Nested objects use YAML-like indentation, and arrays of objects with identical keys become tables: the header users[2]{id,name}: declares the length and field names once, and each following line holds one row of comma-separated values. That removes the repeated braces, quotes and keys that make JSON expensive, often cutting token counts by 30–60% for tabular data.

The catch is that the rest of your stack still speaks JSON. When a model answers in TOON, or when you inherit a prompt fixture written in TOON, this TOON to JSON converter turns it back into standard JSON you can feed to JSON.parse, an API, a test, or a database. It uses the official @toon-format/toon decoder, so quoting rules, escapes, alternative delimiters (tab and pipe), list items with - and nested tables are all handled exactly as the specification defines.

Validate LLM output with strict mode

Because TOON declares [N] lengths, it can detect a truncated or hallucinated answer that JSON would silently accept. With Strict mode on, the decoder fails with a clear message when an array has fewer or more items than declared, a table row has the wrong number of fields, or indentation is inconsistent. That makes it a useful guardrail when you ask a model to produce TOON: decode, and reject the response if validation fails. If you just need to salvage what is there, switch strict mode off and the converter keeps whatever rows parse.

Tips for working with TOON

TOON shines for uniform arrays of objects β€” log lines, product lists, search results, analytics rows. Deeply nested or irregular data compresses less, and plain JSON may even be smaller. Numbers, true, false and null are typed automatically; quote a value such as "007" to keep it a string. Use the Minified indent option for the smallest JSON, or two spaces for review. Need a different target? The same decoder powers the TOON to YAML, TOON to XML and TOON to CSV converters, and you can tidy the result further with the JSON formatter. Everything runs locally, so prompts and data never leave your device.

How to use

  1. Paste TOONPaste TOON text from an LLM response or prompt, or click Load sample.
  2. Pick optionsChoose indentation or minified output and whether strict mode should verify declared array lengths.
  3. Copy the JSONCopy the formatted JSON or download it as a .json file.

Frequently asked questions

What is TOON?
TOON (Token-Oriented Object Notation) is a compact, indentation-based encoding of the JSON data model designed for LLM prompts. It declares array lengths and field names once, so uniform lists of objects use far fewer tokens than JSON.
Is the conversion lossless?
Yes. TOON encodes exactly the JSON data model β€” objects, arrays, strings, numbers, booleans and null β€” so decoding produces the same JSON that was encoded.
What does strict mode do?
It checks that every array has the number of items declared in its [N] header and that tabular rows have the declared number of fields. Turn it off to recover data from truncated or slightly wrong LLM output.
Is my data uploaded?
No. Decoding uses the official TOON library and runs entirely in your browser.
Advertisement