JSON to YAML
Convert JSON to YAML and back, with type inference and clean formatting.
JSON input
YAML output
Enter JSON on the left to convert it.
What is JSON to YAML?
A JSON to YAML converter re-serializes JSON data as YAML — the indentation-based format that dominates configuration files: Kubernetes manifests, Docker Compose stacks, GitHub Actions workflows, CI/CD pipelines, and Helm values files. JSON is what APIs return and code manipulates; YAML is what humans hand-edit, because it drops the braces and quotes, allows comments, and reads cleanly at a glance. This direction comes up whenever JSON has to become configuration: turning an API response or exported settings into the base of a YAML config file, generating a manifest template from structured data, or preparing values a platform like Kubernetes expects in YAML form. The conversion is lossless for the data itself — objects become mappings, arrays become dash-prefixed sequences, and strings, numbers, booleans, and null carry over unchanged. Because YAML infers types from unquoted text, the emitter quotes values that would otherwise be re-read as a different type (a string like "true" or "007" stays quoted), so your JSON types survive a YAML round trip.
How to use JSON to YAML
- Paste any JSON value — object, array, or scalar — into the left panel. There's no need to pretty-print it first; the output is re-formatted regardless.
- The equivalent YAML renders on the right as you type — nested structures become indented mappings and sequences, no button to click, no round trip to wait on.
- Skim the output for values that came out quoted — a string like "true" or "8080" is deliberately quoted so YAML re-reads it as a string, not a boolean or number.
- Copy the result straight into your config file, or hit the swap button if you later need to turn YAML back into JSON.
Examples
Simple JSON object → YAML
Input
{ "name": "Production", "replicas": 3, "enabled": true, "metadata": null }
Output
name: Production replicas: 3 enabled: true metadata: null
Nested array → YAML
Input
{ "services": [ { "name": "web", "port": 8080 }, { "name": "api", "port": 3000 } ] }
Output
services: - name: web port: 8080 - name: api port: 3000
Type-ambiguous strings are quoted to stay strings
Input
{ "debug": "true", "code": "007" }
Output
debug: "true" code: "007"
Common mistakes
- Expecting comments to appear in the output — JSON has no comment syntax, so there is nothing to carry across; annotate the generated YAML by hand afterwards.
- Being surprised by quotes around values like "true" or "8080" — the emitter quotes type-ambiguous strings on purpose so YAML re-reads them as strings rather than a boolean or number.
- Assuming keys will be sorted or re-grouped — the output preserves the JSON object's exact key order, so an unorganized input produces an unorganized config.
Why use this tool
- Lossless for core types — objects, arrays, strings, numbers, booleans, and null convert without data loss, and the emitter quotes anything YAML would misinterpret.
- Human-readable output — clean, two-space-indented block YAML that drops straight into a Kubernetes manifest, Compose file, or CI pipeline.
- Type-safe emission — strings that look like booleans, numbers, or null are quoted automatically, so re-reading the YAML yields the exact JSON types you started with.