JSON \u21c4 TOON

Shrink JSON for LLM prompts with TOON. Paste JSON and get TOON — a compact notation that writes arrays of similar objects as a table with a single header — or paste TOON to get JSON back. See the size difference against pretty and minified JSON, with every conversion verified to round-trip.

JSON vs TOON

JSONTOON
{"tags":["a","b"]}tags[2]: a,b
{"items":[{"id":1,"qty":2},{"id":2,"qty":5}]}items[2]{id,qty}: 1,2 2,5

When to use it

  1. Fit more records into a model's context window.
  2. Cut API costs on data-heavy prompts.
  3. Feed tabular data to an LLM more readably.
  4. Decode TOON returned by a model.

How to Use

  1. Choose JSON → TOON or TOON → JSON.
  2. Paste or drop files.
  3. Compare sizes and copy the result.

Features

  1. Both directions
  2. Tabular arrays
  3. Comma, tab or pipe
  4. Round-trip verification
  5. Size comparison
  6. Batch to ZIP

FAQs

What is TOON?

Token-Oriented Object Notation, a compact, human-readable encoding of JSON designed for LLM prompts.

How much does it save?

Most on arrays of same-shaped objects — often 30–60% versus pretty JSON. Deeply nested or irregular data saves less.

Is the conversion lossless?

Yes. Each conversion is decoded back and checked against the input.

Which delimiter should I use?

Comma is most readable; tab often tokenizes smallest.

Are token counts exact?

No, they're a 4-characters-per-token estimate. Use the LLM Token Counter for exact numbers.

Technical Details

The encoder implements the core syntax of TOON spec 1.x: - **Objects:** key: value lines with two-space indentation. - **Plain-value arrays:** written inline with their length, such as tags[2]: a,b. - **Same-shape object arrays:** where every object has the same primitive fields, written once as a header (items[2]{sku,qty}:) followed by one delimited row per item. This removes the repeated keys and punctuation that make JSON expensive. - **Mixed arrays:** fall back to - list items. Strings are quoted only when they would be ambiguous: empty, padded, containing the delimiter, a colon or brackets, or looking like a number, boolean or null. Comma, tab or pipe can be the delimiter. Every conversion is decoded again and compared with the input to verify it round-trips. The decoder also validates the declared array lengths and row widths.

Data & CSV Tools

Data & CSV Tools

  • TOML Formatter
  • JSON Deep Merge
  • JSON Lines \u21c4 CSV
  • SQL INSERT to CSV
  • JSON Normalizer
  • CSV \u21c4 YAML
  • XSD Viewer
  • CSV Column Extractor