How to convert JSON to YAML
- Add your .JSON file - drop it in the box above or click to browse.
- Convert it to .YAML in a few seconds.
- Download your new .YAML file.
What to expect
- The conversion is lossless - JSON objects, arrays, strings, numbers, booleans, and null all map exactly to YAML equivalents.
- YAML supports comments (lines starting with
#) but converters cannot add them for you; add comments manually after converting. - Bare YAML values such as
yes,no,on, andoffcan be misread as booleans by some parsers - check the output if your data contains these strings.
Frequently asked questions
Is converting JSON to YAML lossless?
Yes. JSON's data model is a strict subset of YAML's, so every key, value, and structure carries over exactly - nothing is dropped or changed.
Can I convert YAML back to JSON?
Yes, the reverse is equally lossless. With yq, run
yq -oj file.yaml > file.json.Why does my YAML parser reject the converted file?
The most common cause is tab characters used for indentation - YAML requires spaces only. This usually happens when a file is hand-edited after conversion; replace tabs with spaces and the parser should accept it.
Is a `.yaml` file the same as a `.yml` file?
Yes -
.yml and .yaml are both valid extensions for the same format and are accepted by all standard YAML parsers.