YAML ↔ TOML Converter 🔒 Your data never leaves your browser.

Convert config files between YAML and TOML formats.

Ctrl+SDownload

About this tool

YAML and TOML both describe structured configuration, just with different syntax and different homes. YAML drives Kubernetes manifests, Docker Compose files and CI pipelines (GitHub Actions, GitLab CI); TOML is the format of choice for Rust's Cargo.toml and Python's pyproject.toml. Porting settings from a Compose service into a Cargo project — or the other way around — usually means retyping everything by hand. This online YAML to TOML converter (and TOML to YAML, in reverse) translates both ways instantly, keeping nested tables, arrays and data types intact.

Powered by js-yaml and smol-toml, both loaded only on this page. Your configuration files never leave the browser — safe even for files that reference internal hostnames, ports or environment names.

Frequently asked questions

What is YAML used for, and what is TOML used for?

YAML is the default for Kubernetes manifests, Docker Compose files and CI pipelines (GitHub Actions, GitLab CI) — it handles deep nesting well. TOML is the format Rust's Cargo.toml and Python's pyproject.toml use — it reads more like an .ini file and is popular where flat, human-editable config matters. You'll often need to convert between them when porting settings from a container-based project into a Rust or Python one, or vice versa.

Do my comments survive converting between YAML and TOML?

No — and this is a common gotcha. Both YAML and TOML parsers discard comments while reading the document; only the data survives. This tool parses your input into an in-memory object and re-serializes it from scratch, so any `#` comments in either format are lost in the output. If a comment documents something important, copy it over by hand afterward.

Does array-of-tables syntax ([[section]]) round-trip correctly?

Yes. TOML's `[[section]]` is just an array whose elements happen to be tables (objects). When converting TOML → YAML, it becomes an ordinary YAML sequence of mappings; converting that sequence back to TOML reproduces the `[[section]]` blocks, because smol-toml recognizes 'an array where every element is a plain object' and emits array-of-tables syntax for it automatically.

Is my YAML or TOML data uploaded anywhere?

No. The conversion runs entirely in your browser using the js-yaml and smol-toml JavaScript libraries — nothing you type or paste here is ever sent to a server. That makes it safe to use even for config files that reference internal hostnames, credentials placeholders, or other environment-specific details.

How do I turn my docker-compose.yml settings into a TOML config for a Rust or Python project?

Switch to the 'YAML → TOML' tab, paste the relevant section of your docker-compose.yml (for example, just one service's `environment:` block or a custom settings block you added), and the equivalent TOML appears instantly on the right — ready to paste into Cargo.toml, pyproject.toml, or any custom `.toml` config file your app reads. Note that the whole pasted document must resolve to a single object at the top level; if you paste the full compose file starting at `services:`, that's fine since it's a mapping, but a bare list (like just the `ports:` array on its own) will show an error since TOML has no way to represent an array as its root document.

Can I convert TOML back to YAML, not just YAML to TOML?

Yes — this is a two-way converter. Click the 'TOML → YAML' tab (or hit Swap after a YAML → TOML run) to paste TOML and get equivalent YAML back, with the indent width you choose applied to the output. Both directions share the same parser-then-reserialize approach, so nested tables, arrays and array-of-tables all convert correctly either way.