JSON ↔ TOON

JSON vs TOON: a side-by-side comparison

JSON and TOON describe the same data. The difference is how many tokens each spends doing it. This page compares the two on syntax, cost, readability, and model accuracy so you can decide where each belongs.

The short version

 JSONTOON
Token cost for LLMsBaseline30-60% lower
StructureBraces, brackets, commasIndentation
Array of objectsField names repeated per rowField names declared once
QuotesEvery key and stringOnly when needed
Lossless round-tripYesYes
Best forAPIs between servicesData sent into LLM prompts

Where the tokens go

Consider a list of three products. In JSON, the keys id, name, and price appear three times each, every value is comma-separated, and the whole thing is wrapped in brackets and braces:

{
  "products": [
    { "id": 1, "name": "Pen",    "price": 10 },
    { "id": 2, "name": "Pencil", "price": 5 },
    { "id": 3, "name": "Eraser", "price": 8 }
  ]
}

TOON declares the fields once and lists the rows:

products:
  - id: 1
    name: Pen
    price: 10
  - id: 2
    name: Pencil
    price: 5
  - id: 3
    name: Eraser
    price: 8

As the array grows, JSON's per-row overhead grows with it while TOON's header cost stays fixed — which is why the savings get larger on bigger datasets.

Readability and accuracy

TOON is generally easier for a human to scan because there is less punctuation between you and the values. For models, the indentation-based layout is familiar from YAML and outline formats in training data, and benchmarks have shown extraction accuracy on par with or slightly above JSON — while spending far fewer tokens.

Rule of thumb: keep JSON for communication between your own services and databases. Convert to TOON only at the LLM boundary, where every token is billed.

See it on your data

Paste a real payload into the converter and the live counter shows the exact token difference for your structure — no guessing from averages.