TOML to YAML
Convert TOML into YAML: choose the indent width, single or double quotes and forced quoting; TOML dates become ISO strings, while broken TOML reports the line and column plus document stats.
Runs in your browserEvery computation happens in your browser — your data never leaves this device.
YAML
TOML dates and times become ISO strings; integers beyond the JavaScript safe range stay lossless as strings.
What this tool does
- Turn Cargo.toml, pyproject.toml and other TOML config into the YAML that Kubernetes, Ansible or Docker Compose expect.
- Handle dates safely: TOML date-time values are written as quoted ISO strings so a YAML parser cannot reinterpret them as timestamps and shift the time zone.
- Keep big integers exact: numbers beyond the JavaScript safe range are emitted as strings, so trailing digits are never rounded away.
- Match your project style: 2–8 space indentation, single or double quotes, force quotes on every string, key sorting and no line wrapping.
Example
Input
title = "UniKit" version = 1.2 created = 1979-05-27T07:32:00Z [server] host = "localhost" port = 8080 tags = ["toml", "yaml"]
Output
title: UniKit
version: 1.2
created: '1979-05-27T07:32:00Z'
server:
host: localhost
port: 8080
tags:
- toml
- yaml
Defaults are 2-space indentation, single quotes and unlimited line width. The date is written as a quoted string so YAML will not turn created into a timestamp; the stats panel reports 1 date, 9 lines and 128 bytes.
Frequently asked questions
How is this different from TOML to JSON?
The JSON version emits JSON text — dates also become ISO strings, but there are no quote-style or sorting options. This one emits YAML, so you can control indentation, quotes and line width, and arrays are written as YAML block sequences.
Why are dates wrapped in quotes?
YAML 1.1 parses an unquoted 1979-05-27T07:32:00Z as a timestamp type, and parsers disagree about its time zone. Quoting it keeps the value a plain string that is never rewritten.
Can big integers lose precision?
No. Integers outside ±9007199254740991 are written as strings and counted in the “big integers (as strings)” stat, so Snowflake-style IDs survive intact.
What about empty input or broken TOML?
Empty input asks you to enter some TOML. A syntax error reports “TOML syntax error: line X, column Y” together with the parser message, and no partial output is shown.
Does the conversion happen locally?
Yes. Parsing and serialisation run in your browser; nothing is uploaded and it works offline.
Keywords:tomlyamlconvertserializetoml 转 yaml配置格式转换序列化缩进