ToolHarbor

JSON to TOON Converter

Convert JSON to TOON (Token-Oriented Object Notation) and see token savings. Compact, LLM-friendly format.

Features

  • Convert JSON to TOON format with one click
  • See byte-level size comparison between JSON and TOON
  • Automatic table format for arrays of uniform objects
  • Handles nested objects, arrays, and primitive values
  • Copy TOON output to clipboard for use in LLM prompts
  • Real-time size reduction percentage display

How to Use

  1. 1Paste your JSON data in the input area or click "Load Sample" for example data
  2. 2Click "Convert" to transform JSON to TOON format
  3. 3Check the size comparison cards to see how much space was saved
  4. 4Copy the TOON output to use in your LLM prompts or data pipelines

Examples

Array of objects (best case)

Input

[{"name":"Alice","age":30},{"name":"Bob","age":25}]

Output

{name,age}[2]
Alice	30
Bob	25
Nested object

Input

{"server":{"host":"localhost","port":8080},"debug":true}

Output

server:
  host: localhost
  port: 8080
debug: true

What Is TOON and Why Use It?

TOON (Token-Oriented Object Notation) is a compact, human-readable encoding of the JSON data model designed specifically for LLM prompts. It combines YAML-like indentation for nested objects with a CSV-style tabular layout for arrays of uniform objects, achieving significant token savings while remaining easy for both humans and models to read.

The biggest savings come from arrays of objects with the same fields — a common pattern in API responses, database results, and structured data. Instead of repeating field names for every object (as JSON does), TOON uses a header row with field names followed by tab-separated values. For a table with 100 rows and 5 columns, this can reduce size by 40-60%.

Token savings translate directly to cost savings when using LLM APIs. If you include structured data in your prompts — user profiles, product catalogs, log entries, or any tabular data — converting from JSON to TOON before sending it to the model reduces the number of input tokens and therefore the API cost.

TOON uses explicit length markers like [N] for arrays and {fields} headers for table structures. These markers help LLMs parse the data reliably, reducing errors in structured data extraction and improving the accuracy of model responses when working with tabular information.

The format supports the full JSON data model — objects, arrays, strings, numbers, booleans, and null — with deterministic, lossless round-trips. Any valid JSON can be converted to TOON and back without losing information.

Frequently Asked Questions

Related Tools