TOON to JSON Converter

Convert TOON (Token-Oriented Object Notation) back into standard JSON, for example the output of an LLM or a TOON file from a prompt. Checks array lengths and marks the exact line of any error. Runs in your browser, so your data is never uploaded.

TOON Input

Ln 1, Col 1Empty

JSON Result

Your result will appear here.
No result yet

What Does This Converter Do?

It reads TOON, the compact Token-Oriented Object Notation used to send data to large language models with fewer tokens, and writes the same data as normal JSON. Use it to check what a TOON block really contains, to turn an LLM's TOON answer into JSON your code can read, or to confirm that a JSON to TOON conversion kept every value.

How to Convert TOON to JSON

  1. Paste your TOON, drop a .toon or .txt file on the box, or load it from a link with URL.
  2. Pick the JSON indentation, or Minified.
  3. Click Convert to JSON, or press Ctrl + Enter.
  4. Copy the result, download it, or send it to another tool with Open in.

Example

TOON
users[2]{id,name}:
  1,Emily
  2,James
JSON
{
  "users": [
    {
      "id": 1,
      "name": "Emily"
    },
    {
      "id": 2,
      "name": "James"
    }
  ]
}

How to Read TOON

TOONJSON
name: Emily"name": "Emily"
Indented lines under customer:A nested object
tags[2]: gift,express"tags": ["gift", "express"]
items[2]{sku,qty}: and one row per lineAn array of objects with those keys
Lines starting with - Items of a list that is not a table
"007", "true"Strings (quotes keep them from becoming numbers or booleans)
42, true, nullNumber, boolean, null

The delimiter (comma, tab or pipe) is read from each array header, so all three kinds of TOON work without any setting.

Common TOON Errors

  • Wrong number of rows: the header says [3] but only 2 rows follow, e.g. "Expected 3 tabular rows, but got 2". This often happens when an LLM shortens a list. Fix the count, or turn off Strict length check to accept it.
  • Uneven indentation: nested lines must use 2 spaces per level, e.g. "Indentation must be exact multiple of 2".
  • A row with too many or too few values, usually because a value contains the delimiter and has no quotes.

The error message shows the line number, and that line is marked red so you can fix it quickly.

Tips

  • Asking an LLM to answer in TOON? Give it a short example of the format first, then convert its answer here.
  • Need to check the JSON afterwards? Send it to the JSON Validator or JSON Viewer with Open in.
  • TOON looks a little like YAML. For real YAML files, use YAML to JSON.

Frequently Asked Questions

How do I convert TOON to JSON?

Paste your TOON and click Convert to JSON. Tables like users[2]{id,name}: become arrays of objects, indented lines become nested objects, and you can copy or download the JSON.

Why do I get Expected 3 tabular rows, but got 2?

The [N] in an array header must match the number of rows. An LLM sometimes shortens a list without changing the count. Fix the number, or turn off Strict length check to accept the rows that are there.

Does it support tab and pipe delimiters?

Yes. The delimiter is read from each array header, so TOON written with commas, tabs or pipes all converts without any setting.

Is my data uploaded?

No. The conversion runs in your browser and your data never leaves your device.

Related Tools