TOML to YAML
What is a Toml To Yaml?
TOML and YAML are both human-friendly configuration formats, used by different ecosystems. Rust and Python packaging use TOML, while Kubernetes, Docker Compose, GitHub Actions and Ansible use YAML. This converter translates TOML into equivalent YAML, which helps when moving settings between tools or comparing the two formats.
How to use it
- Paste TOML content.
- Copy the generated YAML.
Example
TOML input:
title = 'Site'
[server]
host = '0.0.0.0'
port = 8080
[[users]]
name = 'asha'
admin = trueYAML output:
title: Site
server:
host: 0.0.0.0
port: 8080
users:
- name: asha
admin: trueMapping rules
- TOML tables become nested YAML mappings with indentation.
- Arrays of tables become YAML sequences of mappings, written with dashes.
- Integers, floats and booleans keep their types.
- TOML date-times are written as YAML timestamps or strings.
Differences to keep in mind
- Comments are not carried over by most parsers, so add them back manually if needed.
- YAML type guessing: strings that look like other types, such as
yes,no,onor1.10, may be read differently by some YAML 1.1 parsers. A good converter quotes them; check your output for such values. - Indentation matters in YAML: always use spaces, never tabs.
Frequently Asked Questions
Are comments preserved when converting TOML to YAML?
Usually not, because parsers discard comments. Re-add important comments manually.
How are TOML arrays of tables represented in YAML?
As a sequence of mappings, with each item starting with a dash.
Why should some YAML strings be quoted?
Older YAML parsers interpret values like yes, no and on as booleans. Quoting keeps them as strings.
Can YAML use tabs for indentation?
No. YAML requires spaces for indentation.
Which format should I choose for a new project?
Follow your ecosystem: TOML for Rust and Python packaging, YAML for Kubernetes, Docker Compose and CI pipelines. TOML is simpler and less ambiguous, while YAML handles deep nesting more compactly.
Is the conversion done locally?
Yes. Parsing and conversion happen in your browser, so configuration files with internal hostnames or settings are not uploaded.