JSON to YAML Converter
Convert JSON to readable YAML with 2 or 4-space indentation, optional key sorting, literal blocks for multi-line strings and multi-document output. Free.
Runs entirely in your browser. Your data is never uploaded.
Related Tools
View AllWhat is JSON to YAML?
Convert JSON into human-friendly YAML. Strings that YAML would misread (like yes, 123 or null) are quoted automatically, multi-line strings use literal | blocks and a top-level array can be written as one YAML document per item.
How to use JSON to YAML
- Paste JSON into the JSON input box, or use Load sample or Open file.
- Choose Indentation (2 or 4 spaces), Sort keys and Top-level array → one YAML document per item.
- The YAML output updates as you type; use Copy or Download.
Example
{"name":"Ada","langs":["en","fr"],"active":true} name: Ada langs: - en - fr active: true
When to use JSON to YAML
Use it to write configuration for Kubernetes, Ansible, GitHub Actions or Docker Compose from JSON data. Key order is preserved unless you sort it; YAML comments cannot be generated because JSON has none.
How JSON to YAML works
The JSON is parsed and dumped with js-yaml. Lines are never folded, references are inlined, and the dumper quotes any string that would otherwise be read back as a different type. With multi-document output, each element of a top-level array is written after its own --- separator.
Common Use Cases
- Turn a JSON API response into a readable YAML snippet
- Create Kubernetes manifests from JSON generated by a script
- Write CI configuration from JSON templates
- Produce multi-document YAML from an array of resources
FAQs
Why are some strings quoted?
Values like "yes", "123" or "null" would be read back as booleans, numbers or null, so they are quoted to keep them strings.
Can I get one document per array item?
Yes, enable the multi-document option and each item is written after a --- line.
Is the output valid for Kubernetes?
It is standard YAML; Kubernetes accepts it as long as the JSON structure itself is a valid manifest.