How to use it
- Choose a direction and, for YAML output, a style.
- Paste your data into Input. The result updates as you type.
- Copy or download the result.
About
JSON and YAML describe the same kinds of data, but YAML is easier to read and edit by hand, which is why it’s used for config files in tools like GitHub Actions, Docker Compose and Kubernetes. This converts between them using the open source js-yaml library.
- Block is the everyday YAML style: one key per line, nested with indentation.
- Flow keeps the top level as blocks but writes nested objects and lists on one line, like JSON. It’s compact for short values.
- Quoted puts every string in double quotes, so nothing can be misread.
Watch for strings like y, no, on or off. Older YAML readers treat those as true or false, so js-yaml quotes them automatically. It’s known as the “Norway problem”, after the country code NO.
Questions
Are comments kept when converting YAML to JSON?
No. JSON has no comments, so they’re dropped.
Why does my YAML have quotes I didn't expect?
Values that YAML could read as a number, date or true/false are quoted so they stay strings.