Decode a TOON block back into standard JSON. Lossless, instant, and 100% in your browser.

Input - TOON
Output - JSON
Ctrl+Shift+CCopyCtrl+KClearTOON is lossless - JSON → TOON → JSON produces identical output

Share this tool

Found it useful? Help a fellow developer discover it.

https://developertoolkit.dev/tools/toon-to-json

Convert in the other direction

Going the other way, compressing JSON into TOON to cut prompt tokens?

Convert JSON to TOON

Open JSON to TOON Converter

What is TOON, and why decode it?

TOON, short for Token-Oriented Object Notation, is a compact encoding for structured data designed to be cheap to send to a language model. It removes the repeated keys, braces, and quotes that make JSON expensive in a prompt, declaring a field header once and then listing rows beneath it. That saves roughly 40% of the tokens compared with pretty-printed JSON. The catch is that nothing downstream of your prompt speaks TOON. Your application code, your database, and your test assertions all expect JSON. This page handles that last step: paste the TOON a model returned, get back ordinary JSON you can parse.

When you need this direction

Working with model output

  • ·A model was asked to reply in TOON and you need JSON to parse
  • ·Reading a TOON payload captured in a prompt log or trace
  • ·Writing test fixtures against a TOON-formatted response
  • ·Debugging why a decoded field is not the type you expected

Working with your own data

  • ·Verifying a JSON to TOON conversion survived the round trip
  • ·Restoring a TOON block stored to save space
  • ·Comparing a TOON payload against the original JSON
  • ·Handing TOON-encoded data to a tool that only reads JSON

How to convert TOON to JSON

  1. Paste the TOON block. This page opens in the TOON to JSON direction, so there is nothing to switch first.
  2. Keep the indentation intact. TOON uses indentation to mark the rows belonging to a field header, so a block reflowed by a chat client may not decode as intended.
  3. Read the JSON. Decoded output appears on the right, pretty-printed with 2-space indentation.
  4. Copy or download. Take the JSON straight into your code, or save it as a .json file.

Frequently Asked Questions

How do I convert TOON to JSON?

Paste your TOON into the left panel. This page opens already set to the TOON to JSON direction, so decoded JSON appears on the right immediately, pretty-printed and ready to copy. Everything runs in your browser.

What does TOON stand for?

Token-Oriented Object Notation. It is a compact serialization format built for language model prompts. Instead of repeating every key on every record the way JSON does, it declares the field names once as a header and lists the values as rows beneath, which removes most of the punctuation and repetition that consume tokens.

Is decoding TOON back to JSON lossless?

Yes. TOON represents the same data model as JSON, so a JSON document encoded to TOON and decoded again returns the original structure, with types and nesting intact. You can confirm this yourself using the Swap button to round-trip a payload.

Why does my TOON decode into the wrong shape?

Indentation is almost always the cause. TOON uses leading whitespace to mark which rows belong to a field header, so a block that has been reflowed, wrapped, or had its indentation stripped by a chat interface or terminal will decode differently. Copy the raw text rather than rendered output.

How much smaller is TOON than JSON?

Roughly 40% fewer tokens than pretty-printed JSON for typical record-shaped data, and the saving grows with the number of records, because the field names are written once rather than once per object. Uniform arrays of objects benefit most. A single small object saves very little.

Can I check how many tokens my payload uses?

Yes. The AI Token Counter measures the same text against the tokenizers for GPT, Claude, Gemini and other models, so you can compare the TOON and JSON forms directly and see the saving for your own data rather than relying on an average.

How do I convert JSON to TOON instead?

Use the Swap button to flip direction in place, or open the JSON to TOON converter, a separate page written around the encoding direction and the token savings it produces.

Is my data sent anywhere?

No. Decoding happens entirely in your browser with client-side JavaScript. Model responses frequently contain customer data or internal context, so nothing is transmitted, stored, or logged.

Related Tools