How to convert YAML to JSON
- Add your .YAML file - drop it in the box above or click to browse.
- Convert it to .JSON in a few seconds.
- Download your new .JSON file.
What to expect
- Comments are dropped - JSON has no comment syntax, so all YAML
# ...lines disappear from the output. - YAML anchors and aliases expand - each reused block is written out in full in the JSON, so the file may be larger than expected.
- YAML 1.1 bare booleans (
yes,no,on,off) may be treated as strings by modern tools; check the output if your file uses them.
Frequently asked questions
Is YAML-to-JSON conversion lossless?
For data, yes - all values, keys, and structures copy over intact. The only loss is YAML comments, which JSON cannot represent.
Can I convert JSON back to YAML?
Yes, equally lossless. With yq:
yq -oy file.json > file.yaml.What happens to multi-document YAML files?
JSON has no multi-document concept; tools like yq combine them into a single JSON array - confirm that is what your consuming tool expects.
Why does yq write `null` where my YAML had an empty value?
An empty YAML value (
key: with nothing after it) is a valid null, and JSON represents it explicitly as null - this is correct behavior.