About the JSON to YAML
Convert JSON into clean, human-friendly YAML, the format used by Kubernetes manifests, GitHub Actions, Docker Compose and many config files.
Key features
- Clean, idiomatic YAML 1.2 output
- Preserves nesting, arrays and data types
- Long strings are never wrapped or broken
- Strings that look like numbers or booleans are quoted safely
- YAML syntax highlighting in the output
- Download as a .yaml file
Why convert JSON to YAML?
YAML is the configuration language of modern infrastructure. Kubernetes manifests, Docker Compose files, GitHub Actions and GitLab CI pipelines, Ansible playbooks, Helm charts, OpenAPI specs and countless app configs use it. It expresses the same data as JSON, but without braces, brackets and quotes, which makes it easier to read and edit by hand.
If you've generated or downloaded a config in JSON, or you're translating documentation examples, converting to YAML saves tedious manual rewriting.
Side by side
{
"apiVersion": "apps/v1",
"kind": "Deployment",
"metadata": { "name": "web" },
"spec": {
"replicas": 3,
"ports": [80, 443]
}
}
apiVersion: apps/v1
kind: Deployment
metadata:
name: web
spec:
replicas: 3
ports:
- 80
- 443
JSON vs. YAML at a glance
| JSON | YAML | |
|---|---|---|
| Comments | ❌ | ✅ # comment |
| Readability | Good | Excellent |
| Strictness | Very strict | Indentation-sensitive |
| Best for | APIs, data exchange | Configuration files |
| Multi-document files | ❌ | ✅ --- separators |
YAML gotchas the converter handles for you
- The "Norway problem." In YAML 1.1,
NO(the country code) is read asfalse. Strings like this are quoted in the output. - Version numbers.
"1.10"stays a string instead of becoming the number1.1. - Special characters. Strings containing
:,#or leading spaces are quoted so they parse correctly.
Tips
- Indentation matters in YAML. Always use spaces, never tabs. The output uses 2 spaces, the standard for Kubernetes and CI files.
- Validate before converting. Invalid JSON is reported with line and column; the JSON Fixer can repair it.
Related tools
Converting to another config format? Try JSON to TOML for Rust and Python projects, or JSON to XML for enterprise systems.
How to use the JSON to YAML
- Paste your data into the input box, upload a file, or click Sample to try it out.
- Adjust the options above the editor if you need to (indentation, delimiter, and so on).
- The YAML appears instantly in the output panel. Any errors are shown with their line and column.
- Click Copy to copy the result, or Download to save it as a file.