TOON Formatter & Validator

Free Validate · Re-encode with chosen delimiter & indent · Syntax highlighted
Indent
Delimiter
TOON INPUT
OUTPUT
// TOON output
Lines: Est. tokens:

Plus d'Outils pour Développeurs

TOON→JSON
Vers JSON
JSON→TOON
Pour LLMs
Formateur JSON
Formater & valider
Base64
Encoder/Décoder
URL Encoder
Encodage URL
Regex
Tester en direct
Formateur YAML
Formater & valider
JSON→YAML
Vers YAML

About TOON Formatter & Validator

Validate & Re-encode TOON

Parses your TOON via a full round-trip through the data model, then re-serialises it cleanly. Catches structural errors, malformed tabular arrays, and invalid scalar values.

Delimiter & Indent Control

Choose comma or pipe as the tabular delimiter and set 2 or 4-space indentation for nested objects. Useful for re-encoding TOON to match a specific LLM prompt style or downstream parser.

Tabular Array Optimisation

Uniform arrays of objects are automatically collapsed into the compact tabular header-plus-rows format, maximising token savings when sending data to an LLM.

Confidentialité d'abord

All formatting runs in your browser — no data is sent to any server. Safe for TOON payloads containing business data, PII, or proprietary schemas.

Questions Fréquentes

What is TOON?

TOON (Token-Oriented Object Notation) is a compact, lossless encoding of the JSON data model designed to reduce token count when sending structured data to large language models. It uses YAML-style indentation for objects and a CSV-style tabular layout for uniform arrays, achieving up to 60% fewer tokens than equivalent JSON.

Why format TOON before sending to an LLM?

Consistent formatting helps LLMs parse structure reliably. The formatter ensures tabular arrays are properly collapsed, indentation is uniform, and all scalar values are correctly quoted — reducing the chance of the model misreading the structure.

What is the tabular array format?

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

Is formatting TOON lossless?

Yes. The formatter works by parsing TOON into the full JSON data model and then re-encoding it. All values, types, and structure are preserved. The only changes are whitespace normalisation and delimiter/indent adjustments you explicitly choose.

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