Search tools...⌘K
JSON to YAML Converter
Convert JSON to YAML and YAML back to JSON, entirely in your browser.
Indent
JSON input
YAML output
How to Convert JSON to YAML
- 1
Paste your JSON
Drop in a JSON object or array. A Kubernetes Deployment is preloaded so you can see the output shape straight away.
- 2
Pick the direction
JSON to YAML is the default. Use Swap to reverse it and feed the result back in, which is handy for round-tripping a config.
- 3
Set the indent
Two spaces is the YAML convention and the Kubernetes default. Switch to four if your house style calls for it.
- 4
Copy or download
Copy the result into your manifest, or download it as a file. Nothing is sent to a server at any point.
Frequently Asked Questions
No. The conversion runs in your browser using JavaScript. Your JSON and YAML never leave your device, which makes this safe for Kubernetes secrets, environment configs and any payload containing credentials.
YAML is a superset of JSON that adds comments, multi-line strings and less punctuation, which makes hand-edited configuration far easier to read and review. Every valid JSON document is also valid YAML, so converting from JSON to YAML never loses information.
No. JSON to YAML is lossless because YAML can represent everything JSON can. The reverse direction can lose YAML-only features: comments are dropped, anchors and aliases are expanded into duplicated values, and dates may become strings, because JSON has no equivalent for any of them.
Press Swap to reverse the direction, then paste your YAML. The converter parses YAML 1.2 and emits formatted JSON using the indent setting you have chosen.
Strings are quoted when leaving them bare would change their meaning — values like yes, no, on, off, null, or anything that looks like a number or a date. Quoting keeps the round trip exact.
Converting YAML to JSON reads the first document in the stream. Split multi-document files on the --- separator and convert each part if you need all of them.