Skip to content

Converts JSON to Token-Oriented Object Notation (TOON). TOON is a compact, human-readable serialization of JSON designed for LLM prompts. To TOON lives in the Data format category of the fx menu. See the TOON specification for format details.

ParameterTypeRequiredDefaultDescription
Inputstringyes—JSON to encode as TOON. Accepts a JSON string, or a structured value from a previous step (object, array, number, boolean, or null). Empty Input is rejected; JSON null is valid.
DelimiterstringnoCommaDelimiter for tabular array rows and inline primitive arrays. Comma (default) matches the TOON library; use Tab or Pipe when values contain commas or a consumer expects that separator.
Indent sizenumberno2Spaces per indentation level in nested TOON output (same default as @toon-format/toon). Increase for readability; decrease for denser LLM prompts.

Studio shows these descriptions on each parameter. Options map to the library’s non-deprecated delimiter and indentSize encode settings (deprecated indent and encode replacer callbacks are not exposed).

TypeDescription
stringTOON-encoded representation of Input.
  • Input must be valid JSON (or an already structured value, including JSON null). Empty or missing Input raises an evaluation error; invalid JSON also raises an evaluation error.
  • Delimiter must be one of Comma, Tab, or Pipe.
  • Encoding follows the official @toon-format/toon rules for tabular arrays and quoting.
Encode a JSON object as TOON

Turn a small JSON object into a compact TOON string you can pass to an LLM prompt or store for later decoding with From TOON.

  1. Set Input to a JSON object. Paste:

    Input
    {"ok":true}
  2. Leave Delimiter as Comma and Indent size as 2.

  3. Confirm Output value is:

    Output
    ok: true
Encode a tabular array with a pipe delimiter

Use a pipe delimiter when commas appear in field values or when a downstream model expects | separators.

  1. Set Input to:

    Input
    {"users":[{"id":1,"name":"Ada"},{"id":2,"name":"Bob"}]}
  2. Set Delimiter to Pipe.

  3. Confirm Output value is:

    Output
    users[2|]{id|name}:
    1|Ada
    2|Bob