YAML to TOML

Parse and convert YAML to TOML.

Enable JavaScript to use the interactive tool. The guide below explains how it works.

YAML to TOML Converter

What it does

This tool converts a YAML document into TOML. Paste YAML on the left and the TOML equivalent appears on the right, ready to copy into a file such as pyproject.toml or a Cargo manifest.

Why someone uses it

Step-by-step instructions

  1. Paste your YAML into the input.
  2. If validation fails, correct the YAML (usually indentation).
  3. Copy the TOML from the output.

Examples

Input:

title: Example
owner:
  name: Sam
servers:
  - host: alpha
    port: 8080

Output (shape): title = "Example", a [owner] table with name = "Sam", and a [[servers]] array-of-tables entry with host and port.

Understanding the results

YAML mappings become TOML tables, and lists of mappings become arrays of tables written with double brackets. Simple lists become TOML arrays. TOML requires that the document root be a table, so a YAML file whose top level is a list or a single value cannot be converted. TOML also has no null value; YAML null entries cannot be represented and may cause an error or be dropped. Comments and anchors in the YAML do not appear in the output; aliases are expanded.

FAQs

Common mistakes

Use cases

Related tools

All tools

Guides and articles