YAML to TOML
Convert YAML to TOML, with tables for nested maps and arrays of tables for lists of objects.
YAML to TOML
Paste YAML — a Kubernetes manifest, a GitHub Actions workflow, an Ansible playbook, or an app config file — and this tool converts it to equivalent TOML. Nested mappings become TOML tables, and a list of objects becomes an array of tables, so the result is a shape a Cargo.toml or pyproject.toml reader already understands.
Five options shape the output. Sort keys alphabetically reorders every table's keys for a predictable diff. Multi-line strings as blocks renders a value with a line break as a TOML triple-quoted block instead of an escaped one-liner. Inline tables for shallow maps collapses a mapping whose own values are all scalars into one { a = 1, b = 2 } line, while a mapping that itself nests another mapping keeps its own [table] header. Preserve comments carries a YAML # comment written above a key into the TOML output above that key. Empty values decides what happens to a key with no value, since TOML has no null: omit the key, or write it as an empty string.
The converter accepts LF and CRLF line endings, single- and double-quoted strings, flow collections such as [a, b] and {a: 1}, and literal (|) and folded (>) block scalars with their chomping indicators. It validates the document as it parses: a duplicate key, an unterminated string, or bad indentation stops the conversion with the exact line number to fix, rather than guessing. Anchors, aliases and multiple YAML documents in one file are not supported, since TOML has no equivalent for either — expand anchors first if your file uses them.
Everything runs in your browser. The YAML you paste is never uploaded anywhere. Copy the TOML output, download it as a .txt file, or send it into another tool's input to keep working on it.