YAML to TONL Converter
Input YAML
or drop a file anywhere
Output TONL
Your TONL appears here as you type.
Paste data to see token savings
Convert YAML to TONL with our free online converter.
Example: YAML input and real TONL 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: 15#version 1.0
root{env,healthcheck,ports,service}:
env{DB_POOL_SIZE,LOG_LEVEL}:
DB_POOL_SIZE: 10
LOG_LEVEL: info
healthcheck{intervalSeconds,path}:
intervalSeconds: 15
path: /healthz
ports[2]: 8080,9090
service{image,name,replicas}:
image: "registry.example.com/checkout:2.4.1"
name: checkout-api
replicas: 3TONL output is 66% larger 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).
YAML to TONL: what changes
- 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 TONL: TONL output starts with #version 1.0 and a root key, lists field names in braces, and sorts keys alphabetically. On small payloads the header and per-object field lists make it larger than TOON; TONL earns its place through its query, schema, and streaming tooling.
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 TONL
TONL (Token-Optimized Notation Language) is a compact text format that maps one-to-one to JSON and ships with a query API, schema validation, and streaming. Savings are roughly 32-45% versus JSON in the TONL project's own measurements.
- ✓Lossless round trip to JSON
- ✓Query and aggregation API
- ✓Schema validation (TSL)
- ✓Streaming for large files
Why Convert YAML to TONL?
Use TONL when you want a compact text format plus tooling around it: querying, schema validation, or streaming. For plain prompt compression, TOON is usually the simpler choice.
YAML to TONL: Frequently Asked Questions
How do I convert YAML to TONL?
Paste your YAML into the editor on json2toon.co. The tool detects the input and produces TONL instantly, then you copy the result. Conversion runs entirely in your browser, so nothing is uploaded to a server.
Is the YAML to TONL converter free?
Yes. Converting YAML to TONL 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 TONL?
Convert YAML to TONL with our free online converter.
What should I watch out for when converting YAML to TONL?
TONL output starts with #version 1.0 and a root key, lists field names in braces, and sorts keys alphabetically. On small payloads the header and per-object field lists make it larger than TOON; TONL earns its place through its query, schema, and streaming tooling.
Is my data safe when I convert YAML to TONL?
Yes. The YAML to TONL 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.