YAML ↔ JSON ↔ TOML
Convert any direction, entirely in your browser.
Convert any direction, entirely in your browser.
YAML, JSON, and TOML all describe the same shapes — maps, lists, strings, numbers, booleans —
so conversion is parse-then-reserialize. This page bundles proven parsers
(js-yaml, smol-toml, native JSON), runs them locally,
and reports parse errors from the source format directly. Handy for moving a docker-compose
block into a TOML config, or flattening YAML into JSON for an API call.
Watch for the corners each format cannot express: TOML has no null and needs an object at the
root; JSON has no comments or dates; YAML happily parses no as a boolean. The
parser output shown here is exactly what a program reading your file would see — which makes
this a decent YAML debugger too.
No. Parsing and re-serializing happen in your browser with bundled JavaScript parsers. Config files full of hostnames, keys, and internal paths never leave the page.
TOML requires a table (object) at the top level — a bare array or scalar has no TOML representation. Null values are also not part of TOML; remove them or convert to YAML instead.
No. Conversion goes through the parsed data structure, and comments are not data — every format drops them on the way through. Key order is preserved where the target format allows it.
YAML 1.2 via the js-yaml parser — the same library used across the Node ecosystem. Anchors and aliases are resolved during parsing, so the output contains the expanded values.