FormatterHQ

TOML to YAML Converter

Paste TOML and get equivalent YAML: tables become nested mappings, [[arrays of tables]] become lists and TOML dates become YAML timestamps.

Input TOML
Output YAML
Ready.

How to use the TOML to YAML Converter

  1. Paste your TOML file into the input editor.
  2. Click Convert. Syntax errors are reported with the reason.
  3. Check the YAML output, especially quoted values and dates.
  4. Copy the YAML or download it as a .yaml file.

Convert TOML files with the TOML to YAML converter

This TOML to YAML converter parses TOML 1.0 with smol-toml and writes block-style YAML with js-yaml. It is useful when you move a project between ecosystems, for example taking settings from a Hugo config.toml into a Kubernetes or GitHub Actions workflow, or when you simply find YAML easier to scan than a long list of TOML tables.

Example

A Rust manifest:

[package]
name = "acme-cli"
version = "0.3.1"
edition = "2021"

[dependencies]
serde = { version = "1.0", features = ["derive"] }
tokio = "1"

[profile.release]
lto = true
opt-level = 3

YAML output:

package:
  name: acme-cli
  version: 0.3.1
  edition: '2021'
dependencies:
  serde:
    version: '1.0'
    features:
      - derive
  tokio: '1'
profile:
  release:
    lto: true
    opt-level: 3

Notice the quotes around '2021', '1.0' and '1'. They were strings in TOML, and without quotes YAML would read them as numbers, so the converter keeps their type explicit. 0.3.1 is not a valid number and needs no quotes.

How TOML types map to YAML

  • Tables and dotted tables ([profile.release]) become nested mappings.
  • Inline tables such as { version = "1.0" } become ordinary block mappings.
  • Arrays of tables ([[databases]]) become a YAML list of mappings.
  • Multi-line strings ('''…''' or """…""") become YAML block scalars (|-).
  • Hex, octal and binary integers like 0xDEADBEEF are written in decimal (3735928559).
  • inf and nan become .inf and .nan.

Dates and times

TOML has native date-time types, and they are written as YAML timestamps. An offset date-time like 1979-05-27T07:32:00-08:00 becomes 1979-05-27T07:32:00.000-08:00, and a plain date like 2021-04-01 stays unquoted. A local time such as 07:32:00 has no plain YAML form, so it is written with an explicit !!timestamp tag; replace it with a quoted string if your YAML consumer does not understand the tag.

Common errors

  • "trying to redefine an already defined table or value" means the same key or table appears twice, which TOML forbids.
  • "invalid value" usually points to a missing value after = or an unquoted string.

Comments are not carried over, since they are not part of the parsed data. To go back, use YAML to TOML. For JSON instead of YAML, try TOML to JSON, and tidy the source first with the TOML formatter if it is hard to read.

Differences to keep in mind

TopicTOMLYAML
NullNo null value existsnull or ~, so converted files never contain it
Comments##, but they are not carried over
IndentationIgnoredDefines the structure; spaces only
TypesAlways explicitInferred from the text, hence the quotes on number-like strings

The last row matters most when you edit the YAML later. Removing quotes from '1.0' or '2021' silently turns them into numbers, and some tools then read the version 1.10 as 1.1. Leave the quotes where the converter put them.

Privacy

The conversion runs in your browser. Your TOML file is not uploaded.

Frequently asked questions

Why are some values quoted in the YAML output?
Values that were strings in TOML but look like numbers, booleans or dates to a YAML parser, such as "2021" or "1.0", are quoted so their type does not change. Unambiguous strings are written without quotes.
How are [[arrays of tables]] converted?
Each [[name]] block becomes one item in a YAML list under that name, with the block's keys as a mapping. The order of the blocks is preserved.
Are TOML comments kept?
No. Comments are discarded by the parser, so the YAML contains only data. Add comments back by hand if you need them.
Can I convert pyproject.toml to YAML?
Yes. Any valid TOML 1.0 file works, including pyproject.toml, Cargo.toml and Hugo or Netlify configs. The result is plain YAML with the same keys and values.

Last updated September 26, 2026

Related tools