JSON ↔ YAML ↔ TOML Converter
Convert between JSON, YAML and TOML with format auto-detection
About this tool
Convert between JSON, YAML and TOML in any direction. The source format is auto-detected as you paste — brackets suggest JSON, key: colons suggest YAML, [tables] suggest TOML — with a manual override for ambiguous input. Conversion goes through a real parse, so the output is guaranteed valid, not a line-by-line text transform.
Each format has real strengths: JSON for APIs and machine interchange, YAML for human-edited config (Kubernetes, CI pipelines), TOML for well-typed config files (Cargo, pyproject). Moving data between them by hand invites indentation and quoting mistakes that this conversion eliminates.
The converter is honest about format limits: TOML has no top-level arrays and no null, and converting such documents reports why rather than silently dropping data.
Frequently asked questions
- Will comments survive conversion?
- No — JSON has no comment syntax, and conversion goes through the parsed data structure, which does not carry comments. Converting YAML → JSON → YAML loses the comments irreversibly; keep the original file when comments matter.
- Why did my YAML "no" become false?
- YAML 1.1 treats yes/no/on/off as booleans, and country code NO famously becomes false. The parser here follows YAML 1.2 (only true/false), but files written for older parsers may still surprise. Quote strings that look like booleans, numbers or dates.
- Why does my JSON fail to convert to TOML?
- TOML requires a table (object) at the top level — arrays or bare scalars cannot be a TOML document — and it has no null. Restructure the data (wrap the array in a key, drop or default the nulls) and it will convert.
- Is YAML a superset of JSON?
- Practically yes — YAML 1.2 parses virtually all JSON documents, which is why pasting JSON into a YAML config usually works. The reverse is not true: YAML's anchors, multi-line scalars and tags have no JSON equivalent and get expanded or stringified on conversion.