JSON to YAML Converter
Paste JSON to convert it into YAML. The result updates as you type.
Advertisement
Why convert JSON to YAML?
Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks and OpenAPI specs are usually written in YAML, but the data you start from — an API response, a kubectl get -o json dump or a config generated by code — is often JSON. This converter rewrites it as YAML with the same structure, so you can paste it straight into your config.
Strings that YAML would misread, such as "54000" (which would become a number) or "yes", are quoted automatically, so the meaning of your data does not change.
Example
JSON input:
{"name":"web","replicas":2,"image":"nginx:1.27","ports":[80,443],"env":{"NODE_ENV":"production","DEBUG":false}}YAML output:
name: web
replicas: 2
image: nginx:1.27
ports:
- 80
- 443
env:
NODE_ENV: production
DEBUG: falseFrequently asked questions
- Is every JSON document valid YAML?
- Yes — YAML 1.2 is a superset of JSON, so YAML parsers can read JSON as-is. Converting gives you the cleaner block style that is easier to read and edit by hand.
- Will numbers and booleans stay the same type?
- Yes. Numbers, true/false and null are written as YAML scalars of the same type, and strings that could be misread as another type are quoted.
- Can I choose the indentation?
- Yes, pick 2 or 4 spaces. Kubernetes and most YAML style guides use 2.
- Is my JSON uploaded anywhere?
- No. The conversion runs entirely in your browser, so your data never leaves your computer.