Will TOON Replace JSON in the AI World?

There's a new format gunning for JSON's throne. It's called TOON - Token-Oriented Object Notation. It hasn't hit mainstream yet  -  but it's coming.

Toon vs JSON
Toon vs JSON

TOON dropped in November 2025. Within weeks, it hit 21,000 stars on GitHub. The spec is at toonformat.dev. SDKs exist for TypeScript, Python, Go, Rust, and .NET.

The promise? 40% fewer tokens. Higher accuracy. Same data.

So will it actually replace JSON? Let me break down what I learned.

The Problem TOON Solves

JSON is everywhere. APIs, configs, logs, tool calls, integrations. It's the default language of structure across software.

But in LLM land, JSON has a problem: it's expensive.

Every brace, every quote, every comma, every repeated key — the tokenizer treats each one as a token or partial token. And you're paying for all of it.

Here's why it hurts:

Cost. Model pricing is per token. More structure = higher bills.

Latency. More tokens = slower inference.

Context pressure. Extra tokens waste context window space.

Agent loops. Structured state gets passed repeatedly. The cost multiplies with every cycle.

At Neoflo, we pass structured context to models constantly — user profiles, transaction history, agent state. I started looking at token breakdowns and realized the punctuation was eating us alive.

What TOON Actually Looks Like

TOON's core idea: declare the schema once, then stream the values.

Here's the same data in both formats:

JSON:

{
  "users": [
    { "id": 1, "name": "Alice", "role": "admin" },
    { "id": 2, "name": "Bob", "role": "user" }
  ]
}

TOON:

users[2]

That's it.

The header users[2]{id,name,role}: declares the array name, length (2 items), and fields. The lines below are just data rows.

No braces. No quotes. No repeated keys. The model doesn't need them — it can infer the structure from the header.

Count the tokens. JSON: 84. TOON: 32. That's 62% savings on this example.

The Benchmarks

The TOON team ran comprehension tests across 4 models using 209 data retrieval questions.

Results:

  • TOON: 73.9% accuracy, 2,744 tokens

  • JSON: 69.7% accuracy, 4,545 tokens

  • YAML: 69.0% accuracy, 3,719 tokens

  • XML: 67.1% accuracy, 5,167 tokens

TOON used 40% fewer tokens than JSON and achieved higher accuracy. The explicit schema headers help models understand structure better than parsing nested braces.

The sweet spot is uniform arrays of objects — the kind of tabular data you'd put in a spreadsheet. Customer lists. Transaction logs. Product catalogs. Agent state objects.

For deeply nested or non-uniform structures, JSON is often still more efficient. TOON isn't magic — it's optimized for a specific shape of data.

So Will TOON Replace JSON?

Short answer: No, not globally. Yes, locally — in AI workflows.

Here's why JSON won't be replaced outside AI prompts.

JSON has massive momentum. Universal parsers. Stable RFC standards. Schema tooling. Validation tools. Streaming parsers. Interoperability contracts.

Replacing JSON globally would mean changing APIs, databases, event pipelines, partner integrations, and decades of tooling. That's not happening.

What actually happens in tech: Standards don't get replaced. They get layered on top of.

HTML wasn't replaced — React layered on top. SQL isn't replaced — ORMs layered on top. HTTP isn't replaced — gRPC layered on top in specific contexts.

TOON won't kill JSON. It'll become a specialized format used where JSON is inefficient — mainly the prompt layer.

The Clean Architecture

Here's how this plays out in production:

Canonical layer (storage / APIs / contracts): Use JSON. Or protocol buffers. Or your database schema. Whatever you're already using.

Prompt layer (LLM boundary): Convert structured objects into TOON at the last moment. Serialize to TOON, embed in prompt, model consumes it.

Logging / debugging layer: Optionally store both. JSON for readability and compatibility. TOON for prompt replication and caching.

Think of TOON as gzip for structured prompts — not the new HTTP.

The model doesn't care about JSON purity. It cares about tokens and structure.

Where TOON Struggles (Today)

Tooling maturity. JSON has decades of battle-testing, security audits, high-performance parsing. TOON is two months old. Expect gaps in validation tooling, IDE support, schema validation pipelines.

LLM training data. Most models were trained primarily on JSON. They haven't seen much TOON. This means some models may need adaptation, and edge cases might produce unexpected results.

Non-uniform data. If your objects have different shapes within the same array, TOON's tabular format breaks down. Stick with JSON for irregular structures.

Human familiarity. Every engineer knows JSON. TOON adds a new format to learn and debug. That's friction.

When to Use What

Use TOON when:

  • Your prompts are heavy on uniform structured data

  • Your agent loop is expensive

  • You're hitting context limits

  • You want stable structure without JSON token overhead

Don't use TOON when:

  • Data is deeply nested or non-uniform

  • Interoperability is the primary objective

  • Data is frequently consumed by non-LLM systems

  • You need battle-tested tooling (early-stage dev)

Production strategy:

Store everything as JSON. Convert JSON → TOON only at the LLM boundary. Convert back if needed.

import { encode } from "@toon-format/toon";

// Your normal JSON data
const data = { users: [...] };

// Convert at prompt time
const toonData = encode(data);

// Send to LLM
const prompt = `Given this data:\n${toonData}\n\nAnswer: ...`;

The Bigger Picture

LLMs don't just change what we build — they change how we represent information.

We're already seeing this:

  • Markdown as a prompt language

  • XML-ish tagging for instruction boundaries

  • Function-call schemas

  • Compressed prompt formats like TOON

JSON isn't being replaced. It's being optimized around.

TOON is one of the first serious attempts at creating AI-native structured notation. It won't be the last. As AI systems scale, expect more formats designed for how models actually consume information — not how humans historically organized it.

The right question isn't "Is TOON better than JSON?"

It's "Where does each format belong in the stack?"

Resources:


Building AI systems that handle structured data at scale? I'm working on exactly this at Neoflo. Always happy to talk through the tradeoffs.