Skip to content
JSON Toolkit

TOON to JSON Converter

Convert

Decode TOON into standard JSON — and catch truncated or malformed model output by line.

Decode TOON back into JSON

TOON (Token-Oriented Object Notation) is a compact way to give structured data to a large language model, but the rest of your stack speaks JSON. This converter decodes TOON into standard, pretty-printed JSON that you can validate, store, query, or send to an API. Paste TOON on the left and the JSON appears on the right as you type, with any problem reported by line.

It is built on the reference TOON implementation, so it reads exactly what the specification defines — and it pairs with the JSON to TOON converter for checking that a round trip comes back unchanged.

How TOON maps to JSON

Each TOON construct has one JSON meaning:

  • key: value lines become object fields; indented lines beneath a key: become a nested object.
  • tags[3]: a,b,c is an inline array of primitives: ["a", "b", "c"].
  • users[2]{id,name}: followed by rows is an array of objects — each row becomes one object with those keys.
  • Lines starting with - are items of an array that isn't a uniform table, such as objects with different keys or nested arrays.
  • Unquoted numbers, true, false, and null become JSON numbers, booleans, and null; anything quoted stays a string, so "42" remains text.

Catch truncated or malformed model output

When a model writes TOON, the array headers make a promise — orders[25] says twenty-five rows follow. With Strict lengths on, the decoder holds the output to that promise, which is the fastest way to notice that a reply hit the output-token limit or skipped a record. A reply that would have silently produced 24 orders instead fails with a clear message.

Turn Strict lengths off when you have edited a table by hand and don't want to keep the count in sync, or when you'd rather salvage whatever rows a cut-off reply contains.

Common TOON errors and what they mean

Errors are shown with the line they occur on. The ones you'll meet most:

  • Expected 3 tabular rows, but got 2 — the table has fewer rows than its [N] header declares. The usual cause is a truncated reply.
  • Expected 2 tabular row values, but got 3 — a row has more cells than the header has fields, often an unquoted value that contains the delimiter.
  • Unterminated string: missing closing quote — a quoted value never closes, typically because the output was cut off.
  • Tabs are not allowed in indentation in strict mode — TOON indents with spaces; tabs are only valid as a delimiter.
  • Duplicate sibling key — the same key appears twice in one object, which JSON can't represent unambiguously.

Pasting TOON from ChatGPT, Claude, or Gemini

Chat replies usually wrap TOON in a fenced code block. You can paste the whole block, fence and all — the fence is removed before decoding, and error line numbers still match what you pasted. Indentation is detected from the document too, so a model that indents with four spaces instead of two decodes without any setting to change.

From TOON to the rest of your pipeline

Once it is JSON, every other tool applies. Check the structure against what you expected with the JSON Schema validator, turn records into a spreadsheet with JSON to CSV or JSON to Excel, or generate types for your code with JSON to TypeScript. The token panel shows what the same data costs as TOON versus JSON, which is useful when deciding whether to ask a model for TOON at all.

Capabilities

Everything in the TOON to JSON Converter

Convert TOON (Token-Oriented Object Notation) back to JSON. Checks array lengths, reports errors by line, and accepts TOON pasted straight from an LLM reply.

Strict length checks

Every [N] header is checked against the rows present, so a truncated reply fails loudly.

Errors by line

Malformed TOON is reported with the line number and what the parser expected.

Paste from a chat

TOON inside a ```toon code fence is accepted as pasted; the fence is ignored.

Any indent width

Two-space, four-space, or other consistent indentation is detected automatically.

Token comparison

See how many tokens the same data takes as TOON, minified JSON, and formatted JSON.

Frequently asked questions

TOON is for the model's side of a conversation. When you ask an LLM to answer in TOON to save output tokens, your code still needs JSON to work with. Decoding the reply turns it back into standard JSON you can validate, store, or pass to an API. It is also the quickest way to check that a TOON file round-trips correctly.

TOON array headers declare how many items follow — users[3] promises three rows. With Strict lengths on, the decoder fails if the count is wrong, which is exactly what happens when a model's reply is cut off mid-table or it drops a row. Turn it off to decode whatever rows are present, for example when you have hand-edited a table.

Yes. Models usually wrap TOON in a fenced code block, ```toon … ```. The converter strips the fence before decoding, and line numbers in error messages still match what you pasted.

No. The TOON default is two spaces, but the indent width is detected from the document, so four-space or other consistent indentation decodes correctly. Mixing widths within one document is still an error, because nesting depth would become ambiguous.

Quoted strings stay strings: "123" decodes to the string "123", while an unquoted 123 becomes the number 123. Unquoted true, false, and null become JSON booleans and null. Escapes inside quotes (\n, \t, \", \\) are decoded as in JSON.

No. Every operation runs entirely in your browser using client-side JavaScript. Your input is never uploaded, logged, or stored on any server — it never leaves your device.

Yes, completely free with no sign-up required. There are no usage limits, no watermarks, and no premium gate on any feature.

Keep going

Related tools