What is TOON?

TOON (Token-Oriented Object Notation) is a compact data serialization format designed specifically for Large Language Model (LLM) prompts. Unlike JSON, which repeats field names for every object in an array, TOON uses a tabular format that declares fields once and streams data as rows. This makes TOON 30-60% more token-efficient than formatted JSON for uniform data structures, directly reducing costs when working with token-based LLM APIs.

Tool Description

The TOON Formatter allows you to reformat TOON code with different delimiters and indentation styles. Paste your TOON code into the input area, select your preferred delimiter (comma, tab, or pipe) and indentation level, and instantly see the formatted output. This is useful when you need to adjust TOON formatting for different contexts or optimize for specific tokenizers.

Features

  • Multiple Delimiters: Choose between comma (,), tab (\t), or pipe (|) delimiters for array values
  • Customizable Indentation: Format with 1, 2, 4, or 8 spaces per indentation level
  • Live Formatting: Automatically reformats as you type or change options
  • Syntax Highlighting: Full TOON language support with color-coded syntax
  • Error Detection: Clear error messages for invalid TOON syntax

Use Cases

  • Optimizing Token Usage: Tab delimiters often tokenize more efficiently than commas, reducing LLM API costs
  • Code Consistency: Standardize TOON formatting across your project or team
  • Readability: Adjust indentation to make TOON data easier to read and understand
  • Format Migration: Convert between different TOON delimiter styles when working with various tools
  • Preparing LLM Prompts: Format TOON data optimally before including it in prompts