01What is TOML to YAML?
TOML and YAML both describe nested config, but tools rarely agree on which one they want. Cargo and pyproject use TOML, while CI systems, Kubernetes and Helm expect YAML. This converter parses your TOML into a data tree and writes it back out as YAML, keeping the original key order. The parser follows the TOML 1.0 specification. It handles [tables] and nested [a.b] tables, and [[arrays of tables]] such as Cargo's repeated [[bin]] entries. Bare, quoted and dotted keys work, so a.b.c = 1 becomes three levels of nesting. Inline tables, multi-line arrays with comments and trailing commas, and all four string forms are supported. That includes basic strings with escapes like \n and \u00e9, literal strings, and both multi-line styles. Numbers get real types. Hex, octal and binary integers become decimal, underscores like 1_000 are removed, and inf and nan become .inf and .nan in YAML. Dates and times are validated, so 2024-13-01 is rejected, and then passed through as quoted strings. Invalid TOML stops the conversion with an error that names the line. A duplicate key, a table defined twice, an unquoted word as a value or an unterminated string all count. We'd rather show you "Line 2: duplicate key" than guess what you meant. On the YAML side, the writer quotes any string a YAML 1.1 or 1.2 parser could misread. That covers yes, no, on, off, null and ~, anything that looks like a number or a date, and strings containing characters like a colon, a hash or braces. Keys get the same treatment. Arrays of tables become lists of mappings, with the first key on the dash line. Here is a small case. The input hex = 0xff followed by yes = "yes" produces hex: 255 and then "yes": "yes". The hex value is now a plain decimal. Both the key and the value are quoted, because older YAML parsers read a bare yes as true. A few limits to keep in mind. Comments are dropped, since the parser keeps data and not formatting. Integers above 2^53 lose precision because the converter uses JavaScript numbers. Date values arrive as strings, not native YAML timestamps. The parsing runs in the page itself, so config files with internal hostnames or keys aren't sent to a server.
Rust, Python and Hugo developers, plus DevOps engineers, who need TOML config in YAML form for CI, Kubernetes or another YAML-only tool. The tool runs entirely in your browser, so your data never leaves your device.
02How to use TOML to YAML
- Paste TOML into TOML Input, or load the Server Config, Cargo.toml or Simple Config example.
- Read the converted YAML Output, which updates as you type.
- If parsing fails, read the error under the panels. It names the line number.
- Click Copy to copy the YAML, or Reset to clear both panels.
03Worked examples
- Input:
title = "App" [server] port = 8080 hosts = ["a", "b"] - Result:
title: App server: port: 8080 hosts: - a - b - A [table] becomes a nested mapping and arrays become block lists.
- Input:
[[users]] name = "ann" [[users]] name = "bob" - Result:
users: - name: ann - name: bob - Each [[users]] entry becomes one item in a YAML list.
- Input:
version = "1.0" enabled = true zip = "01234" when = 1979-05-27T07:32:00Z - Result:
version: "1.0" enabled: true zip: "01234" when: "1979-05-27T07:32:00Z" - Strings that look numeric keep their quotes, and the date-time is output as a quoted string.
- Input:
hex = 0xff yes = "yes" - Result:
hex: 255 "yes": "yes" - The hex integer becomes 255, and yes is quoted even as a key.
- Input:
a.b.c = 1 big = 1_000 x = inf point = { x = 1, y = 2 } - Result:
a: b: c: 1 big: 1000 x: .inf point: x: 1 "y": 2 - Dotted keys nest, underscores vanish, inf becomes .inf, and the key y is quoted because YAML 1.1 reads it as a boolean.
- Input:
a = 1 a = 2 - Result:
Line 2: duplicate key "a" - Invalid TOML produces this error naming the line instead of any YAML.
04Common use cases
- Turning a Cargo.toml or pyproject.toml section into YAML for a GitHub Actions matrix or project docs
- Moving a Hugo site from config.toml to config.yaml
- Translating TOML application settings into a Kubernetes ConfigMap or Helm values file
- Diffing a TOML config against a YAML one by converting both to the same format first
- Checking whether a hand-edited TOML file is valid, using the line-numbered error message
- Seeing exactly how dotted keys and arrays of tables nest before you rewrite a config by hand
05Tips
- A common error source is an unquoted string value like env = production. TOML requires quotes, YAML doesn't.
- Quote very large IDs in the TOML. Integers past 2^53 lose precision because the converter runs on JavaScript numbers.
- Dates come out quoted so every YAML parser reads them the same way. Remove the quotes if your consumer expects a native timestamp.
- Quoted keys like "y" in the output are intentional. YAML 1.1 parsers treat a bare y as a boolean.
- Comments aren't carried over, so copy any important ones into the YAML yourself.
06Related concepts
TOML, YAML, Configuration formats, Array of tables, Data serialization.
Frequently Asked Questions
What is TOML to YAML?
TOML to YAML is a free, browser-based developer tool on AIDToolStack. Convert TOML to YAML format It requires no installation or sign-up and works entirely in your browser.
Is TOML to YAML free to use?
Yes. No sign-up, no fees and no usage cap.
Does TOML to YAML store my data?
No. It runs in your browser; nothing is uploaded.