YAML to TOML Converter

Convert YAML data to TOML online. Paste a YAML mapping and the equivalent TOML text appears instantly, which is useful when writing Cargo.toml, pyproject.toml or migrating configuration to TOML.

FreeOnline Tool
Loading…

How to Use

  1. Paste your YAML content into the box on the left (the top level must be a mapping or object)
  2. The converted TOML appears on the right in real time
  3. If the YAML is malformed or its top level is not a mapping, a specific error message is shown on the right
  4. Click "Load sample data" to see how nested structures and arrays are converted

Features

  • Converts YAML mappings and nested structures into the equivalent TOML dotted key notation
  • Converts YAML arrays into TOML inline array syntax, for example tags = ["a", "b"]
  • Recognizes numbers and booleans and emits them without extra quotes
  • Converts as you type, and shows a clear error message when the YAML is invalid or the top level is not a mapping

Use Cases

Writing a Rust Cargo.toml
Sketch the configuration in YAML if that is what you are used to, then convert it and paste the TOML into Cargo.toml.
Writing a Python pyproject.toml
Turn YAML-style project configuration into the TOML that a Python pyproject.toml file expects.
Migrating a configuration format
Convert the content quickly when a project moves its configuration from YAML to TOML.
Learning how YAML maps to TOML
Compare the same configuration written in both formats to understand the syntax differences.

FAQ

Why must the top level of the YAML be a mapping?
TOML is built around key/value pairs and tables. If the top level of your YAML is an array or a single scalar there is no meaningful TOML structure to map it to, so the tool requires an object at the top level.
How are nested YAML objects converted?
Nested objects become TOML dotted keys. For example package with a nested name: x becomes package.name = "x" rather than a [section] table.
How are YAML arrays converted?
Arrays become TOML inline arrays, so tags: [a, b] is converted to tags = ["a", "b"].
Is my data uploaded to a server?
No. The conversion runs entirely in your browser and nothing is sent anywhere.