How to convert TOML to YAML
TOML and YAML both hold nested settings, lists, text, numbers and true or false. To convert toml to yaml, the tool reads your TOML with a strict parser, then writes the same data as indented YAML: each table heading becomes a key with its settings indented below it, and each array of tables becomes a list of maps.
The built-in sample is a Traefik static configuration. This part of it:
[entryPoints.web]
address = ":80"
[providers.docker]
exposedByDefault = false
[certificatesResolvers.le.acme]
email = "admin@example.com"
storage = "/letsencrypt/acme.json"
[certificatesResolvers.le.acme.httpChallenge]
entryPoint = "web"becomes:
entryPoints:
web:
address: :80
providers:
docker:
exposedByDefault: false
certificatesResolvers:
le:
acme:
email: admin@example.com
storage: /letsencrypt/acme.json
httpChallenge:
entryPoint: webThe full sample reports 17 keys, 10 tables and 17 lines. Text is only quoted when YAML needs it, so :80 stays bare because it does not start with a special character followed by a space.
TOML errors with line, column and a fix hint
Most TOML mistakes are small: a missing quote, a number with a leading zero, a table defined twice. The error message gives the line and column and says what to change. Take this input, which is the Broken sample:
[server]
host = example.com
port = 8080The result is: Invalid TOML at line 2, column 8: invalid value. The value after = is missing or not valid TOML. Text needs double quotes, and true, false and numbers must be spelled exactly. Write the host as "example.com" and the error is gone. Other messages cover a redefined table, a leading zero, an unfinished string and an array missing its closing bracket.
Dates, large integers and special numbers
TOML has real date and time types and YAML 1.2 does not, so these need care. Here is the Numbers and dates sample converted:
id: 9223372036854775807
ratio: 1.0
limit: .inf
launch: 2026-03-01
opens: 08:30:00
starts: 2026-03-01T08:30:00+02:00
answer: "yes"
version: "1.10"- Dates and times are written in ISO 8601 form, unquoted by default. YAML 1.1 readers such as PyYAML read them as timestamps and YAML 1.2 readers keep them as text. Switch Dates and times to Quoted text if you want a string everywhere.
- Integers up to the 64-bit limit keep every digit. YAML itself is exact, but JavaScript readers round numbers above 9,007,199,254,740,991, so those are flagged by path.
- A float such as 1.0 stays 1.0 and does not turn into the integer 1. inf and nan are written the YAML way, as .inf and .nan.
- The words yes, no, on and off are quoted when they are text, so Ansible and PyYAML do not turn them into booleans.
"1.10"is quoted too, so it is not read as the number 1.1.
Convert traefik.toml to traefik.yml
Traefik reads its static configuration from a TOML or a YAML file. If you want to convert traefik toml to yaml, paste the file and copy the result into traefik.yml. Dotted headings such as certificatesResolvers.le.acme become nested keys. Key names keep their exact case, which matters because Traefik option names are case-sensitive.
Check the result against the Traefik documentation for your version, because the tool converts the data and cannot know which options your version accepts.
Convert a Hugo config from TOML to YAML
Hugo accepts its site configuration in TOML, YAML or JSON. To convert hugo toml to yaml, paste your hugo.toml. Menus written as double-bracket menus.main blocks become a list under menus and main. The Hugo sample gives:
baseURL: https://example.org/
languageCode: en-us
title: Field Notes
publishDate: 2026-01-15T09:00:00Z
params:
description: Notes on small tools
comments: true
menus:
main:
- name: Home
url: /
weight: 1
- name: Posts
url: /posts/
weight: 2For front matter in a content file, paste only the lines between the +++ markers. The tool does not read the markers. Turn on Start with --- if you want the opening line, and add the closing --- yourself.
Options explained
- Indent: 2 or 4 spaces per level.
- Sort keys: puts the keys of every table in alphabetical order. Off keeps the order of your TOML.
- Dates and times: unquoted ISO 8601, or quoted text.
- Text quoting: only when needed, or double quotes on every text value and key.
- Quote YAML 1.1 lookalikes: keeps yes, no, on, off, and text such as 12:30:45 or 0b101, as text for YAML 1.1 readers. It is unavailable when every text value is already quoted.
- Multi-line text blocks: text with line breaks is written as a | block. Off writes one quoted line with \n.
- Short lists: one item per line, or a list of up to six short values on one line, such as [80, 443].
- Long text: wrap values longer than 80 characters over several lines, or never wrap.
- Start with ---: adds the document start marker as the first line.
TOML to YAML in Python
Python 3.11 and later can read TOML with the built-in tomllib. PyYAML writes the YAML:
import tomllib
import yaml
with open('config.toml', 'rb') as f:
data = tomllib.load(f)
with open('config.yaml', 'w') as f:
yaml.safe_dump(data, f, sort_keys=False)To go back, use YAML to TOML. To see the data as JSON, TOML to JSON shows it, and JSON to TOML and YAML to JSON cover the other directions. Sort YAML Keys puts the finished YAML in alphabetical order.
Limits
- Comments are not carried over. Add them to the YAML by hand afterwards.
- TOML tables and arrays of tables become YAML maps and lists. The original table layout, such as dotted keys versus headings, is not kept.
- Integers beyond the 64-bit range are rejected by TOML itself and reported as errors.
- The tool checks that the YAML it writes is valid and holds the same data, not that your program accepts the values.
- Fractional seconds in dates are kept to milliseconds.
- Large files take longer to convert, and the preview may lag while you type.
Your TOML is converted in your browser. It is not uploaded or stored. See the Privacy Policy for details.