YAML to TOML Converter
Paste YAML, get TOML. Or paste TOML, get YAML. The converter handles nested tables, arrays, inline tables, and TOML’s native datetime types. Useful when migrating projects between toolchains — e.g., switching a Python project from setup.cfg-style YAML overrides to pyproject.toml, or porting a Rust Cargo.toml to a YAML-based CI config.
How to use the YAML to TOML Converter
Pick a direction with the tabs. YAML→TOML loads js-yaml, parses your YAML to a JS object, then walks the object and emits TOML keys, tables, and arrays. TOML→YAML does the reverse using a small in-browser TOML parser. Both run entirely in your browser — nothing leaves the page.
Type coercion follows the natural target-format conventions: YAML integers and floats become TOML numbers, booleans pass through, strings stay quoted, dates emit as TOML datetime literals. Inline maps and arrays use the short table / array syntax when small enough to keep the output readable.
About YAML to TOML Converter
YAML and TOML are both designed for human-edited config but with opposite trade-offs. YAML is whitespace-sensitive, permissive (a dozen ways to express the same value), and well-suited for deep nesting — which is why Kubernetes, Ansible, and most CI systems chose it. TOML is whitespace-insensitive, strict (one canonical form for each value), and best for flat-ish configs with a few nested tables — which is why Rust’s Cargo, modern Python’s pyproject, and most static-site generators chose it.
Converting between them is mostly mechanical, but there are sharp edges. YAML’s anchors and aliases have no TOML equivalent (this converter resolves them inline). YAML’s implicit nulls become TOML omissions (TOML has no null type). TOML’s dotted-key sugar (a.b.c = 1) round-trips to YAML’s nested mapping. The output is always a valid document in the target format; manual review is wise when migrating production configs because both formats have subtle features the other doesn’t represent natively.
Common use cases
- Switching from
conda env.ymltopyproject.tomlwhen consolidating Python project metadata. - Reading a Rust
Cargo.tomlas YAML to paste into a GitHub Actions workflow that expects YAML inputs. - Comparing Helm values.yaml against a TOML reference config by normalising both to one format and diffing.
- Migrating a static-site generator (Hugo TOML ↔ Jekyll YAML) when moving content between platforms.
Frequently asked questions
Does it preserve comments?
How are YAML anchors handled?
TOML has datetime types \xE2\x80\x94 what does YAML do with them?
2026-05-28T10:00:00Z) so the conversion is lossless in both directions. Some YAML 1.1 parsers may treat them as strings; the converter emits 1.2-style.