chain
T
YAML to TOML error
⌃⏎ run · clear · / focus input
// about this tool

YAML to TOML Online

Updated 2026-08-04

// how to use

  1. 1 Paste your YAML — a CI pipeline, a manifest, an app config.
  2. 2 The TOML appears as you type, with tables and arrays of tables laid out properly.
  3. 3 Copy it into your Cargo.toml, pyproject.toml or app config.

// examples

A mapping becomes a table
Input
database:
  port: 8000
  enabled: true
Output
[database]
port = 8000
enabled = true
A sequence of mappings becomes an array of tables
Input
servers:
  - name: alpha
  - name: beta
Output
[[servers]]
name = "alpha"

[[servers]]
name = "beta"
An empty key is a null, and TOML has none
Input
a:
b: 1
Output
Error — TOML has no null: the key "a" cannot be represented

// common uses

Moving a CI or Compose config into a Rust or Python project Producing a TOML config from YAML you already maintain Migrating a project between the two format ecosystems Checking how a YAML structure looks expressed as TOML tables

// faq

Why does a key with nothing after the colon fail?
Because in YAML that is a null, and TOML has no null. It is an easy one to miss, since an empty key looks like a blank rather than a value. Remove the key or give it a value — in TOML, absent is how you say null. The error names the exact key.
Why can't I convert a YAML document that is just a list?
A TOML document is always a table of key/value pairs, so a top-level sequence has nowhere to live. Give it a key — a `items:` mapping wrapping the list converts fine.
Are YAML anchors and aliases supported?
An alias is expanded into the full value it points at, because TOML has no equivalent of an anchor — the repetition becomes literal. A `<<` merge key is not merged, though; it survives as a key literally named `<<`, which is the same behaviour as our YAML to JSON converter, so the two agree.
What about several documents in one file?
A file with a `---` separator between documents is rejected rather than half-converted. TOML has no concept of multiple documents, so there is nowhere for the second one to go, and quietly converting only the first would hand you a config missing most of its contents.
Does my YAML leave the browser?
No. Everything is converted locally in JavaScript, which matters because CI configs are full of the tokens you would least like to paste into a stranger's server.

Use this via API

Get a free API key →
curl -X POST https://thesnaptools.com/api/v1/tools/yaml-to-toml \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"yaml":"database: port: 8000 enabled: true"}'
Esc
↑↓ navigate open Esc close