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.

  1. 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.

  2. 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.

  3. 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_corrupted when the file could not be parsed. It stops with unsupported_elements when 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

From · YAML

YAML

YAML configuration and data files.

Extensions
.yaml .yml
MIME type
application/yaml
Kind
Text and data
To · TOML

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.

terminal
$ cv convert report.yaml report.toml
$ cv convert report.yaml report.toml

Questions.What people ask about YAML to TOML.

01OF 04

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.

More conversions.Other ways in and out of YAML and TOML.