What this tool does
Config files show up in JSON, YAML, or TOML depending on the tool that reads them — package.json is JSON, GitHub Actions and Docker Compose are YAML, Cargo.toml and pyproject.toml are TOML. This converter removes the "which format was that command expecting again" step: paste what you have, get the other two immediately, in the same layout, no format picker.
Unlike a one-direction converter, it treats all three formats as equal citizens. Edit the YAML panel and the JSON and TOML panels update; edit the TOML panel instead and the other two follow. Comments attached to a key in YAML or TOML travel with that key when you switch between those two formats — they're only lost going into JSON, because JSON itself has no comment syntax to hold them.
Two worked examples
service: web image: nginx:1.27 # pinned version ports: - "80:80" - "443:443" environment: DEBUG: false
service = "web" image = "nginx:1.27" # pinned version ports = ["80:80", "443:443"] [environment] DEBUG = false
[package] name = "demo" version = "0.1.0" [[bin]] name = "cli" path = "src/main.rs"
{
"package": {
"name": "demo",
"version": "0.1.0"
},
"bin": [
{ "name": "cli", "path": "src/main.rs" }
]
}
Notes on lossless-ness
- Comments survive YAML ↔ TOML round trips (tracked per key/item, including nested ones). They're always absent from the JSON panel since JSON has no comment syntax.
- TOML has no
null. Anullfield converting into TOML becomes an empty string, since that's the nearest thing TOML's type system allows. - TOML's top level must be a table. A JSON array or bare scalar at the root has no TOML equivalent — wrap it in an object, e.g.
{"items": [...]}, before converting. - Arrays of objects become YAML sequences of mappings, or TOML
[[array.of.tables]]blocks — both round-trip back to the same array.
Frequently asked questions
Does this tool upload my data anywhere?
How does the format auto-detection work?
key = value / [table] syntax. If that also fails, it falls back to YAML, the most permissive of the three. Whichever parser succeeds becomes the source, and the other two panels are generated from that result.Are comments preserved when converting?
# comments, so a comment on a key in your YAML reappears on that same key in the TOML output, and vice versa — including on nested keys and array-of-table entries, not just top-level ones.What happens with TOML's [[array.of.tables]]?
[[bin]] entries. Converting an array of objects back into TOML re-emits it as [[array.of.tables]] automatically, so files like Cargo.toml or pyproject.toml round-trip correctly.Why does converting JSON to TOML sometimes fail?
{"items": [...]}, then convert.Does it handle null the same way in every format?
null. TOML deliberately has no null type, so a null field converting into TOML is emitted as an empty string, the closest available representation.