JSON to YAML Converter
Convert JSON into clean, readable YAML for config files like Docker Compose, Kubernetes and GitHub Actions.
JSON Input
YAML Result
What Is a JSON to YAML Converter?
A JSON to YAML converter rewrites JSON data in YAML format. YAML holds the same data as JSON, but uses indentation instead of brackets and quotes, so it is much easier for people to read and edit. That is why most config files are written in YAML.
How to Convert JSON to YAML
- Paste your JSON into the JSON Input box, click Upload, or drop a .json file.
- Choose 2 or 4 spaces of indentation.
- Click Convert to YAML, or press Ctrl + Enter.
- Click Copy or Download to save your .yaml file.
JSON vs YAML Example
This JSON:
{
"name": "my-web-app",
"port": 8080,
"services": ["api", "worker"]
}becomes this YAML:
name: my-web-app port: 8080 services: - api - worker
Features
- Keeps numbers, true/false, null, lists and nested objects.
- Puts text in quotes when it could be mistaken for a number or boolean.
- Fixes small JSON mistakes (like trailing commas) automatically before converting.
- Colored YAML result with line numbers, Copy and Download.
- Runs in your browser. Your JSON is never uploaded.
Why Some Values Get Quotes
YAML guesses the type of unquoted values, so the converter adds quotes wherever a guess could change your data:
{ "country": "NO", "version": "1.10", "zip": "01234", "enabled": true, "note": "Line 1\nLine 2" }country: 'NO' version: '1.10' zip: '01234' enabled: true note: |- Line 1 Line 2
Without quotes, 1.10 would be read back as the number 1.1 and 01234 as 1234, and some older YAML tools read NO as false. Text with line breaks uses the |- block style, which keeps each line readable instead of using \n.
Where You Need YAML
- Kubernetes manifests and Helm values
- Docker Compose files (docker-compose.yml)
- CI/CD pipelines such as GitHub Actions, GitLab CI and Azure Pipelines
- OpenAPI / Swagger specs and app config files
A handy workflow: generate or edit the data as JSON, convert it here, then add comments in the YAML. Read JSON vs YAML for a full comparison, and check the result with the YAML Formatter. Some tools, like Rust's Cargo and Python's pyproject.toml, use TOML instead: convert with JSON to TOML.
Frequently Asked Questions
Is this JSON to YAML converter free?
Yes. It is free to use, with no sign-up and no limits.
Why convert JSON to YAML?
YAML is easier for people to read and edit, so it is used for config files in tools like Docker Compose, Kubernetes, GitHub Actions and many CI systems.
Does the converter keep my data types?
Yes. Numbers, true/false, null, lists and nested objects are all kept. Text that could be mistaken for a number or a boolean is put in quotes.
Is my JSON sent to a server?
No. Your JSON is converted inside your browser and never uploaded.