JSON-TOON Converter

Convert JSON data to TOON — a compact, bracket-free encoding optimized for LLM prompts. 40% fewer tokens, fully reversible, runs in your browser.

JSON Input
TOON Output

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, bracket-free encoding of JSON data designed for LLM prompts. It uses indentation instead of brackets, reducing token count by ~40% compared to standard JSON. TOON is fully reversible — convert back to JSON losslessly.

JSON

{
  "user": "Ning",
  "role": "engineer",
  "skills": ["Python", "Go"]
}

TOON

user: Ning
role: engineer
skills[2]: Python,Go

When to Use TOON

Best for

  • Feeding structured data to LLMs
  • Uniform arrays of objects
  • Reducing token costs
  • Adding structural validation

Not ideal for

  • Deeply nested structures
  • Mixed non-uniform arrays
  • Latency-critical paths

Frequently Asked Questions

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, bracket-free encoding of JSON data. It uses indentation instead of brackets and commas, reducing token count by approximately 40% compared to standard JSON. TOON is fully reversible — you can convert back to JSON losslessly.

Why use TOON for LLM prompts?

LLMs process tokens, not characters. TOON is designed to express the same data with fewer tokens, reducing cost and context usage. The official TOON format claims ~40% token reduction on mixed structures, making it ideal for feeding large datasets into prompts.

Is TOON a replacement for JSON?

No. TOON is not meant to replace JSON for APIs, configuration, or general data exchange. It's specifically optimized for LLM input scenarios. For any context where JSON is the standard (APIs, databases, config files), keep using JSON.

Does it work offline?

Yes. All conversion happens entirely in your browser using JavaScript. No data is sent to any server.

Is the conversion lossless?

Yes. TOON is a lossless encoding of the JSON data model. Converting JSON → TOON → JSON produces identical output, and vice versa.