Translate YAML configuration into TOML with optional indentation and key sorting.
Translate YAML configuration into TOML with optional indentation and key sorting. Translate YAML configuration into TOML with optional indentation and key sorting.
Output
Background
When YAML and TOML overlap, and when they don't
Both YAML and TOML aim to be human-readable configuration formats.
They overlap heavily on the data they can represent (mappings,
sequences, scalars), but they differ in syntax and in a few corner
cases. YAML supports tags, anchors, and multi-line scalars; TOML
distinguishes between inline tables and array-of-tables, and
treats dates as a first-class type.
A YAML-to-TOML converter is most useful when migrating a config
file from one tool's preferred format to another's: for example,
moving a Kubernetes manifest into a pyproject.toml snippet, or
re-expressing an Ansible inventory in a Cargo [dependencies]
table.
What survives the conversion
Mappings (key: value in YAML) become TOML tables or key/value
pairs depending on context. Sequences become inline arrays or
[[array.of.tables]] headers. Scalars are preserved as long as
they map cleanly: strings, integers, floats, booleans, and ISO
dates.
What does not
YAML anchors and aliases are flattened during parsing; the
converted TOML contains the concrete value at every alias site,
which is what most consumers want. YAML !!binary tags are not
preserved because TOML has no equivalent. Comments are dropped on
purpose -- neither format guarantees round-trip preservation.
Workflow tips
Before committing the converted TOML, run your project's TOML
linter (taplo, toml-check, etc.). The converter only translates
syntax, not style; the linter catches quoting, indentation, and
key-order issues the converter cannot detect.
Frequently asked questions
Does the converter handle YAML anchors?
Yes. Anchors (`&name value`) and aliases (`*name`) are expanded during parsing, so the TOML contains the resolved value at every alias site. The original anchor names are not preserved.
Will comments in the YAML survive?
No. YAML comments are stripped by every mainstream parser. Add comments back by hand in the TOML if needed.
Can the converter handle multi-document YAML files?
No. The viewer treats each upload as a single document. Use a dedicated tool for multi-document files.
Does TOML support multi-line strings?
Yes. The converter emits TOML's triple-quoted basic strings for any YAML scalar containing newlines, so readability is preserved.
What about YAML `!!binary` data?
TOML has no equivalent for base64 binary blobs. The converter warns and skips those values to avoid silent corruption.
Is my YAML uploaded?
No. Parsing happens locally via js-yaml, and the TOML output is generated locally via smol-toml. Nothing is sent to a server.