YAML to TOON Converter
Input YAML
or drop a file anywhere
Output TOON
Your TOON appears here as you type.
users[3]{id,name,role}:
1,Alice,admin
2,Bob,user
3,Cleo,userPaste data to see token savings
Convert YAML to TOON with our free online converter.
Example: YAML input and real TOON output
The output below was generated by the same conversion code the converter uses, run on this sample when the page was built.
service:
name: checkout-api
image: registry.example.com/checkout:2.4.1
replicas: 3
env:
LOG_LEVEL: info
DB_POOL_SIZE: 10
ports:
- 8080
- 9090
healthcheck:
path: /healthz
intervalSeconds: 15service:
name: checkout-api
image: "registry.example.com/checkout:2.4.1"
replicas: 3
env:
LOG_LEVEL: info
DB_POOL_SIZE: 10
ports[2]: 8080,9090
healthcheck:
path: /healthz
intervalSeconds: 15TOON output is 1% smaller than the YAML input. The same data is 214 characters as minified JSON and 295 as pretty-printed JSON. Sizes are character counts, not tokens: token counts depend on the model's tokenizer (see the tokenizer comparison). Across larger datasets, TOON averages about 43% fewer tokens than JSON (42.6%) according to the official TOON benchmark.
YAML to TOON: what changes
- Configuration files are mostly nested mappings with few uniform arrays, so YAML to TOON saves little. Expect output close to the YAML size; TOON mainly helps when the data contains lists of similar records.
- Reading YAML: Comments are dropped and anchors/aliases are expanded into copies. Unquoted values such as 2021 or 1.0 are read as numbers; quote them in the YAML if they must stay strings.
- Writing TOON: TOON saves the most on arrays of objects that share the same fields: they collapse into one header plus one row per record. Nested or non-uniform objects are written as indented key: value lines and save much less.
About YAML
YAML is a human-friendly data serialization format. It uses indentation instead of brackets, making configuration files more readable.
- ✓Human readable
- ✓No punctuation
- ✓Supports comments
- ✓Great for config
About TOON
TOON (Token-Oriented Object Notation) is an indentation-based format designed for LLM prompts. It uses about 43% fewer tokens than JSON on average (42.6% in the official TOON v4.1 benchmark), ranging from about 33% on mixed/nested structures to about 59% on flat uniform tables.
- ✓About 43% fewer tokens than JSON on average
- ✓Tabular rows for uniform arrays
- ✓Lossless round trip to JSON
- ✓Readable without tooling
Why Convert YAML to TOON?
Use TOON when building LLM-powered applications, optimizing API costs, or when you need compact, readable data for AI models.
YAML to TOON: Frequently Asked Questions
How do I convert YAML to TOON?
Paste your YAML into the editor on json2toon.co. The tool detects the input and produces TOON instantly, then you copy the result. Conversion runs entirely in your browser, so nothing is uploaded to a server.
Is the YAML to TOON converter free?
Yes. Converting YAML to TOON on json2toon.co is free with no account, signup, or usage limit. A free public API is also available for automated, programmatic conversion.
Why convert YAML to TOON?
Convert YAML to TOON with our free online converter.
What should I watch out for when converting YAML to TOON?
Configuration files are mostly nested mappings with few uniform arrays, so YAML to TOON saves little. Expect output close to the YAML size; TOON mainly helps when the data contains lists of similar records.
Is my data safe when I convert YAML to TOON?
Yes. The YAML to TOON conversion happens client-side in your browser. Your source data stays on your device and is never sent to or stored on a server, which makes it safe for private or sensitive payloads.