1001Ferramentas
🔁 Converters

YAML to TOML Converter

Convert config files from YAML to TOML right in your browser, preserving strings, numbers and booleans. Handy for migrating configs between formats.

Moving a configuration from YAML to TOML

YAML and TOML solve the same problem from opposite directions. YAML uses indentation and is economical to write, at the cost of typing rules that surprise people — the famous case of Norway's "no" turning into false. TOML is more verbose, one key equals value per line with explicit types, and in exchange it rarely leaves doubt about what was written.

Paste the YAML and the page returns the TOML equivalent line by line. Each key: value pair becomes key = value. Strings gain quotes, with inner quotes escaped; numbers and the booleans true and false pass through unquoted; inline lists in square brackets are kept as they are. Anything the page cannot read as a pair becomes a comment in the output, so you never lose sight of the original content.

This is a surface conversion, and the limit is worth knowing before you paste a large file: only the root level is translated. Maps nested by indentation, lists written with hyphens across several lines, block scalars with | or >, anchors and references do not turn into TOML tables — they appear commented out. For a flat configuration file, the kind with a couple of dozen direct keys, the output is ready to use.

Frequently asked questions

Why did my nested block become a comment?
Because the conversion runs line by line and does not build the document tree. In TOML a nested map becomes a table with a bracketed header, and deciding where each header starts requires interpreting the whole indentation. Lines that are not simple pairs are commented out, flagging what needs a manual pass.
Does the conversion preserve types?
In the straightforward cases, yes: a number stays a number, true and false stay booleans, and everything else becomes quoted text. Where YAML is ambiguous — unquoted dates, values like yes, on, ~ — the result becomes text, which is the conservative choice: an obvious string beats a type you did not ask for.
Is there a way back?
Yes, under the same conditions: the TOML to YAML page does the reverse for flat files. For configurations with deep structure, the safest route is a library in your language, which loads the whole document into memory before serialising it.

Related Tools