JSON to YAML Converter
convert
output
About the JSON to YAML converter
YAML is the format of choice for config files, CI pipelines, and Kubernetes manifests, but most APIs return JSON. This converter produces block-style YAML that reads like a hand-written document: mappings and sequences use 2-space indentation, multi-line strings become literal blocks, and strings are quoted only when leaving them bare would change their meaning. Conversion runs entirely in your browser.
Minimal quoting rules
A string that looks like a number, boolean, or null(e.g. "2025" or "yes") is single-quoted so it round-trips as a string, as are strings containing colons, leading dashes, comment markers, or surrounding whitespace. Sentence-like text stays unquoted, which keeps the YAML scannable — the opposite of JSON's everything-quoted approach.
Round-trip fidelity
null becomes ~, empty objects and arrays become {} and[], and numbers keep their JSON form. Because the converter understands when plain text would be misinterpreted, converting back (e.g. with a YAML-to-JSON pipeline) returns the document you started with in all but exotic string cases.
Related tools
Validate or reformat the source document first with the JSON formatter, compare two configs with the JSON difftool, or build TypeScript types and JSON Schema with theTypeScript generator andschema generator.
FAQ
Is YAML the same as JSON?
Structurally yes — YAML 1.2 is a superset of JSON — but YAML's looser quoting and block syntax are what make it popular for config files.
Does this support anchors or tags?
Output uses only plain block constructs. Input is JSON, which can't express anchors, so nothing is lost.