Convert YAML to TOML
Turn YAML files into TOML. The same keys and values as TOML, with plain values written before tables, and a top-level list is written under the key items, as [[items]] tables when its entries are objects.
Converted in an isolated sandbox on our serversDeleted after 24 hours
Drop YAML files on the dialor turn it to pick what to do
YAML settings as a TOML file.Keys and values carry over. Comments and anchors do not.
What you get
A TOML file with the same keys and values as the YAML. Plain values are written before tables, as TOML requires.
A YAML file with several documents becomes one list. A top-level list is written under the key items, as [[items]] tables when its entries are objects.
What changes
Comments are dropped. Aliases are expanded, so each alias becomes a full copy of the value it points to. A merge key (<<) is not merged. It is kept as an ordinary key.
Values such as yes, on, 0755 and dates stay text. They are not turned into booleans, numbers or TOML dates.
When it fails
TOML has no null, so a null in an object is dropped and the conversion carries on with a warning. A null inside a list fails, because TOML cannot hold it. An integer beyond the signed 64-bit range fails for the same reason.
The conversion stops with
input_corruptedwhen the file could not be parsed. It stops withunsupported_elementswhen the file holds something TOML cannot carry.To go the other way, use TOML to YAML.
YAML and TOML.What each format is.
The formats
YAML
YAML configuration and data files.
- Extensions
- .yaml .yml
- MIME type
- application
/yaml - Kind
- Text and data
TOML
TOML configuration files, the format of Cargo and pyproject.
- Extensions
- .toml
- MIME type
- application
/toml - Kind
- Text and data
In your code.The same YAML to TOML conversion through the API, for your app or your agent.
$ cv convert report.yaml report.toml$ cv convert report.yaml report.tomlQuestions.What people ask about YAML to TOML.
No. Comments are dropped.
A null in an object is dropped with a warning. A null inside a list fails, since TOML cannot hold it.
Yes. It is written under the key items, as [[items]] tables when its entries are objects.
No. Values such as yes, on, 0755 and dates stay text.