TOML to YAML Converter
Convert TOML configuration files to YAML format.
or drop a file here
TOML vs YAML
TOML and YAML are both human-readable configuration formats, but have different strengths. TOML (used by Cargo.toml, pyproject.toml) has stricter typing and an unambiguous spec; YAML (used by GitHub Actions, Kubernetes, Docker Compose) is more expressive but has subtleties (e.g. implicit booleans, tabs vs spaces). This converter parses TOML into an intermediate object and serialises it with js-yaml. Related: TOML to JSON · YAML to TOML.
Built and maintained by Meet Shah · Last updated
What this tool is used for
- Migrating configuration from a TOML-based tool to a YAML-based one.
- Converting a Rust or Python project's config for a YAML pipeline.
- Producing a YAML fixture from an existing TOML file.
- Comparing a TOML config against a YAML one in the same format.
- Modernising configuration during a toolchain change.
Frequently Asked Questions
- How do TOML tables map onto YAML?
- A `[section]` header becomes a nested mapping, and dotted names nest further — `[a.b]` becomes `a:` containing `b:`. TOML is a flat file DESCRIBING a tree, while YAML expresses the tree directly through indentation, so the conversion is mostly turning headers into levels.
- What does the double-bracket form mean?
- `[[middleware]]` is an array of tables — each repeated block appends one element. In YAML that becomes a sequence of mappings under one key, which is the shape most readers expect. Getting it wrong turns a list of two middlewares into one object with the second overwriting the first.
- Why does TOML exist when YAML already did?
- Because YAML's flexibility is also its hazard: significant whitespace, several string styles, and implicit typing that turns `no` into false. TOML deliberately offers one obvious way to write things and requires quotes on strings, which is why Cargo, Poetry and pyproject.toml chose it.
- Do dates survive the conversion?
- TOML has first-class date and datetime types needing no quotes. YAML has a timestamp type too, so the value survives — but whether the receiving parser reads it as a date or as a string depends on the library and its schema settings, which is worth checking before relying on it.
- Is this a complete TOML implementation?
- It covers what real config files use: tables, arrays of tables, inline arrays, strings with escapes, numbers, booleans and comments. The rarer corners — multi-line literal strings, offset datetimes with fractional seconds — are where to check the output rather than trust it.
Common errors and gotchas
- Losing TOML's explicit types to YAML's implicit ones, where a string can become a number or a boolean.
- Converting a typed TOML date, which YAML represents differently or as a plain string.
- Flattening arrays of tables into a shape that no longer round-trips.
- Dropping comments, which both formats support but converters frequently discard.
- Producing a YAML value that gets reinterpreted, such as an unquoted version like `1.10`.
Related Converters tools
JSON to YAML
Convert JSON into clean, readable YAML instantly.
YAML to JSON
Convert YAML configuration into valid JSON.
JSON to XML
Convert JSON structures into nested XML markup.
HWB to HEX Converter
Convert an HWB color to HEX.
JSON to SQL
Turn a JSON array of objects into SQL INSERT statements.
CSV to XML
Convert CSV rows into structured XML records.
XML to CSV
Flatten repeated XML records into CSV rows.
INI to JSON
Parse INI config sections and keys into JSON.