YAML to TOML Converter

Paste YAML, get a TOML config

Input (YAML)

Output (TOML)

YAML to TOML Converter guide

Moving a project from YAML config to TOML, for example to pyproject.toml or a Hugo site, is tedious by hand. Paste the YAML and get equivalent TOML.

How it converts

  • Maps. Nested YAML maps become [table] sections.
  • Lists. Lists of plain values stay inline, such as features = ["search","export"]. Lists of maps become [[arrays of tables]].
  • Anchors. YAML anchors and merge keys are expanded, since TOML has no references.
  • Empty values. A YAML key with no value is null, which TOML cannot store. Fill it in or remove it first.

Example

title: my-app
server:
  port: 8080
features:
  - search

// converts to

title = "my-app"
features = ["search"]
[server]
port = 8080

Frequently asked questions

Why do I get "TOML has no null values"?
A YAML key with nothing after the colon, or with ~ or null, has no value. TOML cannot store that, so give it a value or remove it.
Why do I get "TOML needs an object at the top level"?
Your YAML starts with a list (lines beginning with -). Put the list under a key first.
Are YAML comments kept?
No. Comments are dropped during conversion.