Why Go from TOML to YAML?
TOML is a great hand-edited config format, but a lot of the ecosystem — Kubernetes, GitHub Actions, GitLab CI, Ansible, Docker Compose — speaks YAML. When a tool or pipeline only accepts YAML, you need to translate your TOML config without changing its meaning. The two formats describe the same underlying data model (a tree of maps, lists, and scalars), so the conversion is lossless in the TOML→YAML direction.
How Tables Become Nesting
A TOML table header becomes an indented YAML key. Where TOML uses flat [section] markers, YAML uses indentation to express the same hierarchy:
title = "My App"
[database]
host = "localhost"
port = 5432
title: My App
database:
host: localhost
port: 5432
The [database] header turns into a database: key whose children are indented two spaces. Dotted TOML headers like [a.b.c] become three levels of YAML indentation.
Arrays of Tables Become Lists of Maps
TOML's double-bracket array of tables maps to a YAML sequence of mappings:
[[steps]]
name = "build"
run = "make"
[[steps]]
name = "test"
run = "make test"
steps:
- name: build
run: make
- name: test
run: make test
Each [[steps]] block becomes one - list item. This is the exact shape CI systems expect for job steps, which is why TOML→YAML conversion shows up so often in pipeline work.
Quoting and Indentation Gotchas
YAML is whitespace-sensitive and has a long list of values that change meaning if unquoted. A converter handles these, but it helps to know why the output quotes certain strings:
- Booleans in disguise —
yes,no,on,off,true,falseare interpreted as booleans in YAML 1.1. A string"yes"must be quoted to stay a string. - Numbers and versions —
1.10parses as the number1.1; a version string like"1.10"needs quotes. - Leading zeros and colons — values like
08:00or0755can be misread; quoting keeps them literal. - Indentation must be spaces, never tabs. A generated file uses consistent two-space indentation.
Verifying the Result
Because YAML is sensitive to formatting, validate the output before committing it to a pipeline. A quick round-trip check — parse the YAML and compare the resulting data structure to the original TOML — catches any quoting surprise. Most CI platforms also offer a config linter; run it once after converting.
Frequently Asked Questions
Is TOML-to-YAML conversion lossless? Yes. Both formats represent the same map/list/scalar model, and everything expressible in TOML has a YAML equivalent, so no data is lost going this direction.
Why does the converter quote some strings and not others?
To protect values YAML would otherwise reinterpret — yes/no as booleans, 1.10 as a number, times like 08:00. Quoting forces them to stay strings.
Can I convert TOML straight into a GitHub Actions or Kubernetes file? The data structure converts cleanly, but each platform expects specific top-level keys. Convert first, then adjust the key names to match the target schema.
Paste your TOML into the converter above to get clean, correctly indented YAML ready for CI pipelines and Kubernetes manifests.