// converters

TOML to YAML.

Convert TOML configuration files to clean YAML. Supports strings, numbers, booleans, arrays, and nested tables. All processing happens locally.

Client-sideInline tablesNo upload

TOML input

YAML output

TOML vs YAML — key differences.

TOML (Tom's Obvious Minimal Language) is a configuration format designed to be unambiguous. Unlike YAML, TOML has strict typing, explicit date/datetime support, and no "surprise" type interpretation. TOML uses sections ([section]) for nesting and inline tables ({ key = value }) for compact objects.

YAML is more flexible but less predictable — the same value can be interpreted differently depending on context. TOML's strictness makes it ideal for config files where correctness matters more than brevity. Convert TOML to YAML when your toolchain requires YAML (Docker Compose, Kubernetes, CI/CD pipelines).

When to convert TOML to YAML.

Tool migration. Cargo (Rust), Pyproject (Python), and many modern tools use TOML. If you're moving to a YAML-based system (Docker Compose, Kubernetes, GitHub Actions), convert your TOML config to YAML.

Config merging. When combining configs from multiple sources — some TOML, some YAML — convert everything to one format before merging. YAML's flexibility makes it easier to add comments, anchors, and overrides.

Documentation. YAML's indentation-based structure is more readable for nested configs. Convert TOML to YAML to create human-readable documentation of your application's configuration.

Conversion details.

TOML sections become nested YAML mappings. Inline tables become nested objects. Arrays become YAML sequences. TOML's strict types (integer, float, boolean, datetime, string) are preserved as YAML types. Comments are stripped. The tool handles multiline strings, dotted keys, and TOML's date/datetime literals.

TOML syntax overview.

TOML uses [sections] for top-level grouping and [[array-of-tables]] for arrays of objects. Keys are always strings and must be quoted if they contain special characters. Values are strongly typed: strings use double quotes, integers have no quotes, floats use decimal points, and booleans are lowercase true or false. Datetimes use ISO 8601 format (2024-01-15T10:30:00Z).

Dotted keys like server.host = "localhost" are shorthand for nested tables. The converter expands them into proper YAML nesting. Inline tables ({ key = value }) map directly to YAML nested objects. This makes TOML to YAML conversion straightforward for most configuration files.

Real-world scenarios.

Cargo.toml (Rust) and pyproject.toml (Python) are the most common TOML files. When deploying a Rust application to Kubernetes, convert your Cargo.toml settings to YAML for use in deployment manifests. When migrating a Python project's build configuration to a CI/CD pipeline that reads YAML, this converter bridges the gap.

Common pitfalls.

TOML's strict type system means you must be careful with values that YAML interprets differently. A bare yes in TOML is a string, but YAML treats it as true. Similarly, TOML requires quotes around strings with special characters, while YAML allows unquoted strings in most contexts. Always review the converted output for type mismatches, especially when converting configuration that relies on these subtle differences.

TOML sections map to YAML nested objects, but very deep nesting can produce output that's harder to read than the original. If your TOML file uses many levels of dotted keys, consider whether the YAML output would benefit from flattening some sections. The converter preserves the full hierarchy, so the output is always correct — readability is the only concern.

FAQ

How do I convert a pyproject.toml to YAML for a CI pipeline?

In Python: `tomllib.load(f)` (3.11+) or `tomli.load(f)` then `yaml.safe_dump(data)`; or use `toml2yaml` CLI tool for one-line conversion.

How do I handle TOML's array-of-tables syntax when converting to YAML?

`[[table]]` in TOML becomes a list of dicts in YAML — `tomllib` parses them correctly as Python list-of-dicts, then `yaml.dump` outputs them as nested arrays.

Does TOML-to-YAML conversion preserve dates and times?

TOML has native date/time types (RFC 3339); `tomllib` returns `datetime` objects which PyYAML serializes to ISO 8601 strings by default — custom representers give full control.

Can I convert TOML to YAML in Node.js?

Yes — use `@iarna/toml` (parse) + `js-yaml` (dump): `yaml.dump(parseToml(tomlString))`; works in any modern Node version.

How do I convert Cargo.toml (Rust) to YAML?

`tomllib.load(open('Cargo.toml'))` → `yaml.safe_dump(...)` in Python; or `tomlq` (Rust port of yq): `tomlq . Cargo.toml` outputs YAML directly.