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.