Skip to content

Menu

YAML to TOML

Convert YAML to TOML format

Runs entirely in your browserConvertersFree, no sign-up
Loading tool

01What is YAML to TOML?

Plenty of tools now want TOML: pyproject.toml, Cargo.toml, hugo.toml, netlify.toml. If your settings already live in YAML, retyping them by hand is slow and easy to get wrong. Paste the YAML here and the TOML appears as you type. The input goes through a YAML 1.2 parser. It understands nested maps and lists, flow collections like [a, b] and {k: v}, quoted strings, literal (|) and folded (>) blocks, anchors, aliases and << merge keys. Trailing comments are dropped, so port: 0x1F # hex turns into port = 31. Scalars follow the YAML 1.2 core schema. Only true and false are booleans. The old YAML 1.1 words yes, no, on and off stay as strings, which surprises people coming from older parsers. The output side follows the TOML 1.0 spec. Plain top-level keys are written first. Nested maps become [section] tables with dotted headers such as [database.credentials]. A table that holds nothing but other tables gets no empty header of its own. Lists of maps become [[array]] tables, one block per item. Lists that mix maps with other values are written inline instead. Keys with spaces or dots get quoted, so a key called a.b stays one key rather than turning into a nested table. Here is a quick case. Give it title: App, then a server map holding host: localhost and port: 8080. You get title = "App", a blank line, a [server] header, then host = "localhost" and port = 8080. A few limits come straight from the formats. TOML has no null. A null value in a map is left out and a comment marks where it was. A null inside a list stops the conversion with an error that names its path, like xs[1]. The top level must be a mapping, because a TOML document is always a table. For the same reason, YAML with several --- documents stops with an error, so convert one document at a time. Number types also need a look. JavaScript keeps no difference between 1.0 and 1, so ratio: 1.0 comes out as ratio = 1. An unquoted version: 1.10 becomes version = 1.1. Quote anything that is really a string before you convert. The conversion runs in the page's own JavaScript. Your config, including any secrets in it, never leaves the tab.

Python, Rust and Hugo developers moving an existing YAML config into a TOML file such as pyproject.toml, Cargo.toml or hugo.toml. The tool runs entirely in your browser, so your data never leaves your device.

02How to use YAML to TOML

  1. Paste your YAML into the YAML Input panel, or pick one of the examples to see the format.
  2. Read the TOML Output panel. It updates on every keystroke.
  3. If an error shows instead, fix the line it names. Common causes are a list at the top level or a null inside a list.
  4. Search the output for comments about null values that were left out, and decide what the target tool needs there.
  5. Click Copy to put the TOML on your clipboard, or Reset to clear both panels.

03Worked examples

Input: title: App server: host: localhost port: 8080
Result: title = "App" [server] host = "localhost" port = 8080
Nested mappings become [tables], and plain keys are written before any table.
Input: servers: - name: a ip: 10.0.0.1 - name: b ip: 10.0.0.2
Result: [[servers]] name = "a" ip = "10.0.0.1" [[servers]] name = "b" ip = "10.0.0.2"
A list of mappings becomes an array of tables.
Input: flags: debug: yes verbose: true version: 1.10 ratio: 1.0
Result: version = 1.1 ratio = 1 [flags] debug = "yes" verbose = true
YAML 1.2 rules keep yes as a string. Unquoted 1.10 and 1.0 lose their trailing zeros, so quote them if they matter.
Input: base: &b timeout: 30 prod: <<: *b host: "a.b" "a.b": x
Result: [base] timeout = 30 [prod] timeout = 30 host = "a.b" "a.b" = "x"
The merge key copies timeout into [prod]. The key a.b is quoted so it stays a single key.
Input: "my key": 1 list: [1, 2, 3] empty:
Result: "my key" = 1 list = [1, 2, 3] # empty was null in the YAML; TOML has no null, so it was left out
Keys with spaces are quoted. A null in a map is dropped and marked with a comment.
Input: xs: [1, null]
Result: Error: "xs[1]" is null inside an array or inline table, and TOML has no null value. Replace it with a real value or remove it.
A null inside a list cannot be skipped quietly, so the conversion stops and names the path.

04Common use cases

  • Moving a Python project's tool settings from a YAML file into the [tool.*] tables of pyproject.toml
  • Porting a Hugo site from config.yaml to hugo.toml without retyping menus and params
  • Turning a YAML list of servers or plugins into [[array]] tables for a Rust app that reads TOML with serde
  • Checking how a deeply nested YAML block will look as dotted TOML headers before you commit to the format
  • Spotting YAML values that TOML cannot hold, such as nulls inside lists, before a migration
  • Showing a teammate how YAML anchors and << merge keys expand once written out as plain TOML

05Tips

  • Write true or false for booleans. This tool follows YAML 1.2, so yes, no, on and off stay as the strings "yes", "no", "on" and "off".
  • Quote version numbers and anything with leading zeros. version: 1.10 becomes 1.1, and 1.0 becomes the integer 1.
  • Anchors and merge keys are expanded, not kept. The TOML repeats the merged values under each table, since TOML has no reference syntax.
  • Run the result through a strict reader such as Python's tomllib or taplo before shipping it. That catches type changes the target program cares about.

06Related concepts

TOML, YAML, Configuration files, Array of tables, Data serialization.

Frequently Asked Questions

What is YAML to TOML?

YAML to TOML is a free, browser-based developer tool on AIDToolStack. Convert YAML to TOML format It requires no installation or sign-up and works entirely in your browser.

Is YAML to TOML free to use?

Yes. No sign-up, no fees and no usage cap.

Does YAML to TOML store my data?

No. It runs in your browser; nothing is uploaded.

Reviews and commentsShow

Reviews

Sign in to leave a review.

Loading reviews…

Comments

Sign in to leave a comment.

Loading comments…

What changed in AI dev tools, once a month

Renames, shutdowns, pricing changes and new MCP setups, each with a source.

Subscribe