JSON to YAML Converter
Convert JSON to YAML and back, both directions, entirely in your browser.
Convert JSON to YAML and YAML back to JSON, in either direction, entirely inside your browser. Useful when you are moving between an API that speaks JSON and infrastructure tooling — Kubernetes, Docker Compose, GitHub Actions, Ansible — that expects YAML. Your configuration is never uploaded, which matters when it contains hostnames, ARNs or environment details.
YAML is a superset of JSON, so every valid JSON document is already valid YAML — the conversion is about readability, not capability. Anchors, aliases and multi-document YAML are parsed but flattened on the way to JSON, which has no equivalent for them.
How JSON to YAML Converter works
YAML and JSON describe the same thing — nested maps, lists and scalars — with very different syntax. YAML is in fact a superset of JSON: every valid JSON document is already valid YAML, which is why converting between them is about readability and tooling conventions rather than capability.
Going from JSON to YAML replaces braces and brackets with indentation, drops the quotes around keys and most strings, and turns arrays into dash-prefixed lists. The result is typically 30% shorter and considerably easier to scan, which is why the infrastructure world settled on it. Going the other way adds all that structure back, which is what you want when feeding a config into code, a JSON-only API, or a schema validator.
A few things do not survive the round trip cleanly, and it is better to know them upfront. YAML anchors and aliases (`&name` and `*name`) let you define a block once and reuse it; JSON has no equivalent, so they are expanded into duplicated content. Multi-document YAML files — several documents separated by `---`, common in Kubernetes manifests — have no JSON counterpart either, so only the first document converts. Comments are lost in both directions, because neither JSON nor the parser's output model retains them.
YAML also has a famous sharp edge worth remembering: unquoted `yes`, `no`, `on` and `off` were treated as booleans in YAML 1.1, which is how the "Norway problem" got its name — the country code `NO` silently becoming `false`. Modern parsers follow YAML 1.2 and treat them as strings, but older tooling may not, so quoting such values is still the safe habit.
Conversion runs locally using js-yaml, the same parser most JavaScript tooling uses, loaded on demand only on this page.
How to use JSON to YAML Converter
Choose a direction
JSON → YAML or YAML → JSON. Switching direction feeds the current result back in, so you can round-trip without retyping.
Paste your document
Paste the text or open a .json, .yaml or .yml file from your device.
Copy or download
Take the converted result to your clipboard, or download it with the right file extension.
Frequently Asked Questions
Is YAML really a superset of JSON?+
Are my config files uploaded?+
What happens to comments?+
Does it handle YAML anchors and aliases?+
Can it convert multi-document YAML?+
Why did my YAML value "NO" turn into false?+
Which indentation does the YAML output use?+
Is this tool free?+
Related tools
APIs, tech stack, DNS, SSL & SEO for any URL
Beautify, minify and validate JSON
Convert CSV ↔ JSON with type detection
Base64 with Unicode and URL-safe support
Decode a JWT and check its expiry
Diff two texts line by line