TOON icon

TOON

Convert between TOON and JSON formats with zero external dependencies

JSON to TOON

AI-generated

Summary

Convert each input item’s selected JSON value to a TOON string and store it in the configured output field. Optionally include estimated token comparison metrics and configure array delimiters, indentation, and safe key folding.

Inputs

  • Input Data — Value to encode. Defaults to the entire input item’s JSON; can also select a field or nested path such as users[0].name.
  • Output Field — Field in each output item where the TOON string is stored; defaults to data.
  • Additional Options — Delimiter for array values (comma, tab, or pipe; defaults to comma), indentation spaces (defaults to 2), key folding (off or safe; defaults to off), and flatten depth when safe folding is enabled (defaults to 999, treated as unlimited). Enable Include Token Metrics to add estimates for JSON tokens, TOON tokens, tokens saved, and reduction.

Output shape

One output item per input item, retaining its existing JSON fields and adding the TOON string under the configured output field.

When token metrics are enabled, also adds a tokenMetrics object with json, toon, saved, and reduction fields. Token counts are estimates calculated as text length divided by four, rounded up. Encoding errors fail the item unless Continue On Fail is enabled.

Links

Discussion