1001Ferramentas
🔂 Converters

TOML to YAML Converter

Convert config files from TOML to YAML right in your browser, preserving strings, numbers and booleans. Handy for migrating configs between formats.

Reading a TOML file as YAML

TOML rules the project files of several languages — Cargo.toml in Rust, pyproject.toml in Python, config.toml in many static site generators. YAML rules a different set: CI pipelines, Kubernetes manifests, Docker Compose. Anyone moving between the two worlds regularly needs to rewrite a configuration from one format into the other.

Paste the TOML and get the YAML version of its key and value lines. Each key = value becomes key: value, quotes around strings are removed — because YAML accepts unquoted strings in most cases — and escaped quotes inside the text are restored. Comments starting with # and blank lines are kept where they were, which makes it easy to compare before and after.

The conversion works at root level. Table headers in square brackets, arrays of tables in double brackets and multiline values with triple quotes do not become nested structure in YAML — they appear commented out, marking the spot that needs review. For a short flat file the output is ready to go; for a full Cargo.toml, treat it as a starting point.

Frequently asked questions

Do I need quotes around strings in the generated YAML?
In most cases no, which is why they are removed. But some values do need them: those starting with # or with sigils such as &, *, %, those containing ": " in the middle, and those YAML would read as another type — yes, no, on, off, null, and versions like 1.10, which become a number and lose the trailing zero. Add quotes by hand in those.
What happens to [table] and [[array of tables]]?
They are marked as comments. Translating those headers would mean rebuilding the whole hierarchy and reindenting everything below them, which is outside the scope of a line-by-line conversion. The comment makes it visible where the structure has to be recreated.
Are dates and times converted?
They pass through as unquoted text, and YAML may reinterpret them as dates depending on the loader. TOML has native date and time types with precise semantics; YAML 1.1 also interprets dates automatically while YAML 1.2 does not. If the date matters, check how the destination loader treats that value.

Related Tools