Migrate configuration between JSON and YAML
Convert a JSON config to YAML (or back) with a formatted intermediate step, and know the type-coercion pitfalls before you commit the file.
- 1 JSON YAML Converter →
For a quick one-way conversion, paste JSON and get YAML directly.
- 2 json-format → json-yaml
Recommended when the source JSON is minified: validate and pretty-print it first, inspect the structure, then convert.
- 3 yaml-convert
The reverse direction. Watch the JSON output for unquoted YAML scalars coerced to booleans or numbers.
- 4
Before committing the migration, review three known pitfalls: unquoted values that look numeric or boolean get coerced (quote version numbers and semver strings); YAML anchors and aliases (&ref / *ref) have no JSON equivalent and are expanded on conversion; duplicate keys are allowed by some YAML parsers and rejected by JSON — dedupe deliberately.
Frequently asked questions
- Is YAML a superset of JSON?
- YAML 1.2 is essentially a superset of JSON 1.2 syntax — most JSON parses as YAML. The reverse is not true: YAML features like anchors, multi-document streams, and unquoted scalars have no JSON representation.
- Why did my version number become a float?
- YAML parses unquoted 1.10 as the number 1.1. Quote version-like strings ('1.10') in YAML to keep them textual.
Workflows that solve this
Learn more
Want to understand why?