Skip to content

TOML to YAML Converter

Convert TOML configuration files to YAML format seamlessly with structure preservation.

TOML to YAML Converter tool

Loading...

Example

Input: title = "App" / [server] / port = 8080

Result: title: App / server: / port: 8080 (port indented 2 spaces under server)

The TOML is parsed into data and written back as YAML, so the [server] table becomes a nested server: mapping.

  1. Paste your TOML configuration content into the input area on the left side.
  2. The tool validates the TOML syntax and reports any parsing errors.
  3. View the converted YAML output with clean indentation and proper mapping structure in the right panel.
  4. Verify that TOML tables and arrays of tables are correctly converted to YAML mappings and sequences.
  5. Click the copy button to copy the YAML for use in your Kubernetes, Ansible, or GitHub Actions workflow.

Moving Config from TOML to YAML

This converter reads a TOML file and writes the same data as YAML with 2-space indentation. A [server] table becomes a server: mapping with its keys indented below it, and [[items]] tables become a - list of mappings. TOML is common in the Rust and Python worlds, in files such as Cargo.toml and pyproject.toml. YAML dominates Kubernetes, Docker Compose, GitHub Actions and Ansible. When a setting has to move from one world to the other, rewriting it by hand is slow and error-prone. Here the TOML is parsed into data first, so the YAML always has the same structure as the input.

Comments are not carried over. An offset date-time such as 2024-01-15T10:30:00Z is written without quotes as 2024-01-15T10:30:00.000Z, which most YAML parsers read as a timestamp. A plain date stays as written. Strings that could be mistaken for another type, such as 'yes' or '123', are quoted in the YAML. If the TOML has a syntax error, the parser's message is shown and nothing is converted. Type YAML in the right-hand panel and the tool converts it back to TOML. That direction needs a mapping at the top level, and keys with null values are dropped, since TOML has no null. The YAML to TOML Converter page explains that direction in more detail, and the YAML Formatter can check the result.

Sources

Frequently Asked Questions

No. The TOML is parsed into data before the YAML is written, and comments are not part of the data. Copy any important notes across by hand as # comments, which work the same way in YAML.
Offset date-times become full ISO 8601 timestamps in UTC with milliseconds, such as 2024-01-15T10:30:00.000Z, without quotes. A local date like 2024-01-15 is written as is. Most YAML parsers read unquoted values in this form as timestamps; parsers that use the YAML 1.2 core schema keep them as strings.
Each [[items]] entry becomes one item in a YAML list under items:. The item starts with - and its keys are indented below. So two [[items]] tables with n = 1 and n = 2 become a list of two mappings, in the same order.

Related Tools

YAML to TOML Converter

Transform YAML documents to TOML configuration format with proper table structure and types.

Developer Tools

TOML to JSON Converter

Parse TOML documents and convert to formatted JSON output with validation and error reporting.

Developer Tools

JSON to YAML Converter

Convert JSON documents to YAML format with syntax validation, clean formatting, and instant preview.

Developer Tools

YAML Formatter and Viewer

Format, validate, and visualize YAML documents with tree view and customizable indentation.

Developer Tools

JSON to TOML Converter

Convert JSON objects to TOML format with type preservation and clean table structure output.

Developer Tools

YAML to JSON Converter

Parse YAML documents and convert to formatted JSON with error reporting and syntax validation.

Developer Tools