TXT · Text & Data tools

YAML to TOML Converter

Input · YAML
Output · TOML
0 Bin0 Bout0lines in0keysEmptyYAML
Go to the full Data Format Converter

YAML to TOML

Convert YAML to TOML. Paste YAML on the left; the TOML output builds on the right as you type.

package:
  name: vayce
  version: "1.0"
dependencies:
  - astro
  - preact

becomes

dependencies = [ "astro", "preact" ]

[package]
name = "vayce"
version = "1.0"

The nested package mapping becomes a [package] table, and the flat dependencies sequence stays an inline array, since TOML supports arrays as ordinary values, it’s only a bare list or scalar at the document’s root that has nowhere to go.

The root must be a mapping

A YAML document that starts with a top-level sequence, - a\n- b\n- c, or a single scalar, has no direct TOML form, since every TOML file begins with key-value pairs. Wrap the value under a key first: items:\n - a\n - b\n - c converts cleanly, with items becoming an inline array.

Null fields disappear

YAML represents a missing or empty value with null, ~, or nothing after the colon. None of those have a TOML equivalent, so any field holding one is dropped from the output entirely rather than written as an empty string. Replace null fields with a real default value first if the destination expects the key to always exist.

Migrating a config file

This pair comes up most when moving a YAML-based config, a GitHub Actions workflow input set or a Kubernetes values file, into a Rust or Python project that reads TOML natively. Check the converted [table] layout against your target tool’s expected schema; TOML allows more than one valid layout for the same data, and this converter picks one consistently rather than a specific house style.

Frequently Asked Questions

TOML documents are always key-value pairs from the first line, so a YAML file that's just a list or a single scalar at the top level has no TOML equivalent. Wrap it under a key, such as items: [...], before converting.

A nested mapping becomes a TOML table, written with a [table.name] header. A YAML sequence of mappings becomes a TOML array of tables, written as repeated [[table.name]] blocks.

They're dropped from the TOML output, since TOML has no null literal. The warning strip notes which fields were removed.

No. Comments are discarded while YAML is parsed, before the value ever reaches the TOML writer, the same as converting YAML to JSON or any other format.

Yes. An aliased value resolves to a full copy of whatever it points to during parsing, so the TOML output has the data duplicated rather than referenced.

Jump straight to a conversion

Full Data Format Converter tool

Explore Our Tools

Browse all tools