JSON to YAML Converter
Convert JSON to clean, readable YAML — for Kubernetes manifests, CI pipelines, and config files.
Why convert JSON to YAML?
Because the config world went YAML: Kubernetes manifests, GitHub Actions, docker-compose, Ansible, OpenAPI specs — all of them expect it. YAML is a superset of JSON carrying the same data model, so the conversion is lossless: keys, values, nesting and array order all survive. What changes is the syntax — braces and quotes give way to indentation, which is exactly why humans find YAML configs easier to scan and review.
What the output looks like
{ "service": { "name": "api", "port": 8080, "tags": ["prod", "eu"] } }
service:
name: api
port: 8080
tags:
- prod
- eu Strings are quoted only where YAML requires it (reserved words like yes, strings that look like numbers, special characters) — everything else stays unquoted and readable. Long lines wrap at 100 characters; the indent width is yours to choose.
Validated before converted
The input is checked as strict JSON first, with the same exact line-and-column errors as the JSON Validator — so you fix problems in the JSON where they are, rather than hunting a mystery in generated YAML. Going the other way? The YAML to JSON converter is the mirror of this page.
Frequently asked questions
Is the conversion lossless?
Yes — YAML represents the complete JSON data model (objects, arrays, strings, numbers, booleans, null), so nothing is dropped or reinterpreted. Converting back with the YAML-to-JSON tool returns the same data.
Why are some strings quoted in the output and others not?
YAML only needs quotes where a bare value would be misread: "yes"/"no"/"on"/"off" (booleans in YAML 1.1 parsers), things that look like numbers ("1.0"), or strings with special characters. The converter quotes exactly those cases and leaves the rest clean.
Can I use the output directly in Kubernetes or GitHub Actions?
Yes — the output is standard YAML 1.2. Note that k8s and CI tools validate semantics (field names, required keys) on top of syntax; the converter guarantees the syntax half.
Does it support YAML anchors or comments?
It never generates them — JSON has no equivalent concepts, and generated anchors would make the output harder to read. Every value is written out explicitly.
Which indent should I pick?
2 spaces is the de-facto YAML standard (Kubernetes docs, GitHub Actions examples, most linters). Use 4 only if your team convention says so; tabs are not valid YAML indentation, so the tab option maps to 2 spaces here.