JSON to TOON

Free Token-Oriented Object Notation · Up to 60% fewer tokens for LLM prompts
Delimiter
Indent
Error
JSON
TOON
// output here

Plus d'Outils pour Développeurs

Formateur JSON
Formater & valider
JSON→YAML
Vers YAML
JSON→CSV
Vers CSV
JSON→XML
Vers XML
Formateur TOON
Formater & valider
TOON→JSON
Vers JSON
Base64
Encoder/Décoder
URL Encoder
Encodage URL

About TOON (Token-Oriented Object Notation)

What is TOON?

TOON is a compact, lossless encoding of the JSON data model designed for LLM prompts. It uses YAML-style indentation for nested objects and a CSV-style tabular layout for uniform arrays — up to 60% fewer tokens than JSON.

Tabular Arrays

TOON's biggest win: arrays of uniform objects collapse into a header row [N,]{fields}: followed by comma-separated data rows — just like CSV but with explicit structure.

Minimal Quoting

Strings are only quoted when necessary — when they look like a number, boolean, null, contain the delimiter, have leading/trailing whitespace, or are empty. Everything else is written bare.

LLM-Optimised

TOON achieves 76% LLM accuracy vs JSON's 75% on data-retrieval benchmarks, while using ~40% fewer tokens. Best used as a translation layer: keep JSON for APIs, send TOON to LLMs.

Questions Fréquentes

How does TOON encode nested objects?

Nested objects use indentation instead of curly braces. Each key-value pair is written as key: value, and nested objects add one level of indentation (2 spaces by default).

What is the tabular array format?

When all objects in an array share the same primitive-valued fields, TOON writes a header [N,]{f1,f2,f3}: followed by one comma-separated row per object. This is the biggest source of token savings.

Is TOON lossless?

Yes. TOON encodes the same objects, arrays, and primitives as JSON. You can round-trip JSON → TOON → JSON without any data loss. Types are preserved through TOON's quoting rules.

When should I use TOON vs JSON?

Use TOON when sending structured data to an LLM as context or input. The token savings directly reduce API cost and allow more data to fit in the context window. Keep JSON for programmatic APIs, databases, and anywhere that requires strict interoperability.

Guide approfondi
Guide JSON Complet
Formater, valider, convertir
Lire le guide