YAML to TOML Converter
Convert YAML configuration files to TOML format preserving data types and nested structures.
YAML to TOML
YAML (“YAML Ain't Markup Language”) is a human-friendly data serialisation format that uses indentation to express structure. It is extremely common for configuration in tools such as Docker Compose, Kubernetes, GitHub Actions, and Ansible, because it is compact and readable.
TOML (“Tom's Obvious, Minimal Language”) is another readable configuration format, but it favours explicit sections and typed values over indentation. TOML is the standard for Rust's Cargo.toml and for Python's pyproject.toml, and is popular wherever a configuration must be unambiguous.
Converting YAML to TOML is useful when you want to move settings between ecosystems, or when you prefer TOML's explicit [table] syntax for a configuration that was authored in YAML. This converter parses the YAML with js-yaml and re-emits it as TOML, preserving data types and nesting.
How structures map
- Scalars — strings, numbers, and booleans are written as TOML values, with quotes added only when needed.
- Nested objects — a nested mapping becomes a
[section], and deeper mappings use dotted paths such as[a.b]. - Arrays of scalars — become an inline TOML array such as
[ a, b ]. - Arrays of objects — become arrays of tables using
[[table]]. - Dates — are emitted as ISO date-time strings.
- Paste YAML — Paste or type YAML configuration in the input area.
- Auto-convert — The TOML output updates automatically. Data types and nested structures are preserved.
- Copy result — Click the Copy button to copy the TOML output to your clipboard.
- Use the TOML — Paste the output into a Cargo.toml, pyproject.toml, or any other TOML configuration file.
app_name: MyApp
debug: false
max_connections: 100
allowed_hosts:
- localhost
- example.com
database:
host: localhost
port: 5432
pool:
min: 2
app_name = MyApp
debug = false
max_connections = 100
allowed_hosts = [ localhost, example.com ]
[database]
host = localhost
port = 5432
[database.pool]
min = 2
Scalar keys are written first, followed by tables. The nested pool mapping becomes the dotted table [database.pool], and the string list becomes an inline array.
- The top level must be a mapping — a YAML document made only of a scalar or a list cannot be represented as a TOML file, so the converter reports an error instead.
- Comments are not carried across — YAML comments are ignored during parsing and do not appear in the TOML output.
- Null values are skipped — TOML has no null, so keys whose value is null are omitted.
- Strings are quoted only when needed — a value is wrapped in quotes if it contains punctuation, is empty, or could be mistaken for a boolean or number.
- Lists of objects become arrays of tables — a YAML list of mappings is written as repeated
[[table]]blocks. - Everything is local — parsing and conversion run entirely in your browser, so configuration never leaves your device.
Is my data sent to a server?
No. All processing happens 100% client-side in your browser using js-yaml for parsing. Your data never leaves your device, which makes the tool safe for configuration that may contain secrets.
What YAML features are supported?
All standard YAML data types are supported: strings, numbers, booleans, null values, arrays, nested objects, and multi-line strings. The top-level document must be a mapping rather than a bare scalar or list.
What is TOML?
TOML (Tom's Obvious, Minimal Language) is a configuration file format designed to be easy to read and write, with unambiguous mapping to hash tables. It is commonly used in Rust and Python projects as Cargo.toml and pyproject.toml.
How are YAML arrays converted?
An array of simple values becomes an inline TOML array such as [ a, b ], while an array of objects becomes a series of [[table]] blocks so each element keeps its own key-value pairs.
Are YAML comments preserved?
No. Comments are discarded when the YAML is parsed, because TOML stores comments separately and they cannot be attached reliably to the derived structure. Keep your original YAML if comments matter.
Why does my YAML fail to convert?
The most common cause is a top-level document that is not a mapping. TOML requires a table at the root, so a YAML file that is only a scalar or a list cannot be represented and the converter reports an error.
When are strings quoted in the TOML output?
A string is quoted when it contains punctuation or whitespace at the edges, when it is empty, or when it could be confused with a boolean or a number. Ordinary bare words such as localhost are left unquoted.
What happens to null values?
Keys whose value is null are skipped, because TOML has no null type. If you need to preserve a placeholder, replace the null with an empty string before converting.