Introduction to TOON

Welcome to JSON TOON Tools documentation. This site provides online tools for working with the TOON format.

What is TOON?

Token-Oriented Object Notation (TOON) is a compact, human-readable encoding of the JSON data model that minimizes tokens and makes structure easy for language models to follow.

TOON is designed as a drop-in, lossless representation of your existing JSON data, perfect for:

  • LLM Input Optimization - Reduce token usage by up to 40%
  • API Communication - Send less data over the wire
  • Data Storage - Store information more efficiently
  • Human Readability - Easy to read and understand

Key Features

Token-Efficient & Accurate

TOON achieves 73.9% accuracy (vs JSON's 69.7%) while using ~40% fewer tokens in mixed-structure benchmarks across 4 models.

Lossless JSON Data Model

Encodes the same objects, arrays, and primitives as JSON with deterministic, lossless round-trips.

LLM-Friendly Guardrails

Explicit [N] lengths and {fields} headers give models a clear schema to follow, improving parsing reliability.

Minimal Syntax

Uses indentation instead of braces and minimizes quoting, giving YAML-like readability with CSV-style compactness.

Tabular Arrays

Uniform arrays of objects collapse into tables that declare fields once and stream row values line by line.

Quick Example

Here's the same data in JSON and TOON:

JSON (358 Tokens):

{
  "users": [
    {
      "id": 1,
      "name": "Alice",
      "role": "admin",
      "active": true
    },
    {
      "id": 2,
      "name": "Bob",
      "role": "user",
      "active": true
    }
  ],
  "metadata": {
    "version": "1.0",
    "updated": "2025-01-15"
  }
}

TOON (198 Tokens - 45% Reduction):

users[2]{id,name,role,active}:
  1,Alice,admin,true
  2,Bob,user,true
metadata:
  version: 1.0
  updated: 2025-01-15

When to Use TOON

TOON excels with:

  • Uniform arrays of objects - Employee records, product catalogs, event logs
  • LLM prompts - Reduce token costs and improve model comprehension
  • API responses - Smaller payloads, faster transfers
  • Data analytics - Tabular data with structure

Consider alternatives for:

  • Deeply nested structures - JSON might be more token-efficient
  • Pure flat tables - CSV is smaller for simple tabular data
  • Non-uniform arrays - Token savings diminish below 60% uniformity

Getting Started

Use the tools on this site to:

  1. Converter - Convert between JSON and TOON
  2. Formatter - Beautify TOON with proper indentation
  3. Validator - Check TOON syntax for errors
  4. Minifier - Create ultra-compact TOON with tab delimiters
  5. Playground - Explore data structures with AST viewer

Continue reading:

  • Syntax Rules - Learn the TOON format specification
  • Examples - See real-world use cases
  • FAQ - Common questions and answers