JSON to YAML Converter
Turn JSON into readable YAML — and convert straight back.
Two formats for the same tree
JSON and YAML describe identical data structures — maps, lists and scalars. The difference is entirely in presentation, and each is better at a different job. JSON is unambiguous and machine-friendly, which is why APIs speak it. YAML is readable and diffable, which is why Kubernetes, Helm, GitHub Actions, Compose and Ansible all chose it for files that humans edit and review.
Converting between them is a routine step: an API hands you JSON, and the manifest you are writing wants YAML. Doing it by hand means re-indenting every nesting level and remembering which strings need quoting.
What this converter is careful about
- Key order is preserved. Alphabetising by default would scramble the reviewable structure of a manifest. Sorting is available as an explicit toggle when you want stable diffs.
-
Ambiguous scalars get quoted. This is the notorious
YAML footgun:
nobecomes boolean false,1.10becomes the number 1.1, and a Norway country code ofNOturns intofalse. Anything that would be re-read as the wrong type is quoted on the way out. -
Multi-line strings become block scalars. A certificate
or a script embedded in a value stays readable as a
|block rather than collapsing into one line of escape sequences.
Converting back
The swap control runs the conversion in reverse. The YAML reader covers the subset configuration files actually use — block mappings and sequences, quoted and plain scalars, flow collections, block scalars and comments. It is not a conforming YAML 1.2 processor: exotic features such as anchors with merge keys, custom tags and multi-document streams are outside its scope, and it will tell you rather than guess. Comments are dropped in the YAML-to-JSON direction because JSON has nowhere to keep them.
Everything happens in this tab
Configuration files are exactly the kind of thing you should not paste into a remote service. They carry registry hostnames, environment values, internal service names and occasionally a secret that should have been a reference. Nothing typed here is transmitted — the parser and the emitter both ship as part of this page.