JSON to YAML Converter
Convert JSON to clean, readable YAML for configuration files, Kubernetes, Docker Compose or CI pipelines. Choose the indentation and optionally sort keys.
Runs in your browser. What you enter is kept for 30 days to improve Toolgrid, then deleted.
How to use the JSON to YAML Converter
- 1 Paste your JSON.
- 2 Choose the indentation and whether to sort the keys.
- 3 Copy the YAML or download it as a .yaml file.
About the JSON to YAML Converter
JSON is great for machines, but YAML is easier for people to read and edit: no braces, fewer quotes and comments allowed. That is why tools such as Kubernetes, Docker Compose, GitHub Actions and Ansible use YAML for configuration. The converter turns any JSON into equivalent YAML.
Objects become indented key: value blocks and arrays become lists with - items. Strings are only quoted when they would otherwise be read as something else, such as "true", "1.0", "null" or a value with a colon, so the YAML means exactly what your JSON did.
The output uses block style throughout, without line wrapping, so long strings stay on one line. Sorting keys makes the output stable and easy to compare. Because YAML 1.2 is a superset of JSON, the result can be loaded by any YAML parser into the same data.
Frequently asked questions
Is the YAML equivalent to my JSON?
Yes. Loading the YAML gives exactly the same data; strings that look like numbers or booleans are quoted to keep them strings.
Can I add comments?
JSON has no comments, but you can add # comments to the YAML afterwards.
Why is "yes" in quotes?
Some YAML 1.1 parsers read yes, no, on and off as booleans. Quoting them keeps them strings in every parser.
Can I convert YAML back to JSON?
Yes, with the YAML to JSON converter.