YAML → TOML Converter
Convert YAML to TOML locally. Comments will be stripped; the root must be a mapping.
How YAML maps to TOML
Both YAML and TOML are human-readable config formats, but they have different data models. This converter routes through JSON — YAML is parsed to a JSON object, then serialised as TOML. Comments and anchors in the YAML source are not preserved.
| YAML construct | TOML equivalent | Notes |
|---|---|---|
| Mapping (object) | [section] | Top-level keys become section headers |
| Nested mapping | [a.b] | Dot-separated section path |
| Sequence of objects | [[items]] | Array of tables syntax |
| Sequence of scalars | key = [1,2,3] | Inline array |
| String | key = "value" | Double-quoted in TOML |
| Integer / Float | key = 42 | Unquoted numeric |
| Boolean | key = true | Lowercase, unquoted |
| null | ❌ not supported | TOML has no null type — conversion fails |
| YAML comment # … | (dropped) | TOML has comments but conversion strips them |
What gets lost in translation
Warning: Comments are stripped. YAML
# comments are not preserved. If you need to carry comments into the output, add them manually to the TOML file after conversion.Warning: null values fail. YAML
~ or null has no TOML equivalent. Replace null values with "", false, or omit the key entirely before converting.Note: Anchors and aliases are expanded. YAML
&anchor and *aliasare resolved to their concrete values before conversion — the aliasing relationship is not preserved.Example
Input
# Application config server: host: "0.0.0.0" port: 8080 tls: true database: url: "postgres://localhost/mydb" pool_size: 10 features: - dark_mode - beta_signup
Output
[server] host = "0.0.0.0" port = 8080 tls = true [database] url = "postgres://localhost/mydb" pool_size = 10 features = ["dark_mode", "beta_signup"]
Frequently Asked Questions
Your files stay on your computer. Dad promised.