YAML ⇄ JSON Converter
Convert YAML to JSON or JSON to YAML instantly, with correct handling of Docker Compose, Kubernetes, and GitHub Actions files. Free, no sign-up.
100% client-side. Conversion runs in your browser using the open-source js-yaml library — nothing you paste here is sent to a server.
YAML Input
Try an example (YAML)
JSON Output
{
"version": "3.8",
"x-common": {
"restart": "unless-stopped",
"environment": {
"NODE_ENV": "production"
}
},
"services": {
"web": {
"<<": {
"restart": "unless-stopped",
"environment": {
"NODE_ENV": "production"
}
},
"image": "myapp:latest",
"ports": [
"8080:80"
]
},
"worker": {
"<<": {
"restart": "unless-stopped",
"environment": {
"NODE_ENV": "production"
}
},
"image": "myapp-worker:latest"
}
}
}Support Our Free Tools
If you find this calculator helpful, please consider supporting our work. Your contribution helps us build and maintain these free tools for everyone.
Buy me a coffeeYAML to JSON — and Back — Without the Gotchas
YAML and JSON represent the same kind of data, but config files rarely stay simple. Docker Compose files lean on anchors and << merge keys to avoid repeating themselves. Kubernetes manifests often bundle several resources into one file, separated by ---. And GitHub Actions workflows use a bare on: key that YAML's older spec would happily misread as a boolean. This converter is built on the open-source js-yaml parser specifically to get all three of those cases right, not just the simple ones.
Real Config-File Edge Cases, Handled Correctly
🐳 Docker Compose anchors
A service using <<: *common to inherit shared config gets its merged, final values in the JSON output — not a literal "<<" key.
☸️ Kubernetes multi-document files
Multiple resources separated by --- in one manifest are automatically detected and converted into a JSON array, one entry per resource.
⚙️ GitHub Actions "on:"
Converting back to YAML correctly quotes "on" as "on": to avoid the YAML 1.1 boolean ambiguity — exactly what you'll see in real workflow files.
🚫 Tab-indentation errors
YAML doesn't allow tabs for indentation. Instead of a cryptic failure, you get a specific error pointing at the exact line.
YAML vs. JSON, in Short
JSON is stricter and more verbose — every string needs quotes, every object needs braces, and there's no way to add a comment. YAML trades some of that strictness for readability: indentation replaces braces, quotes are usually optional, and # comments are allowed (though they're dropped when converting to JSON, since JSON has no comment syntax of its own). That's why YAML dominates config files meant for humans to read and edit — Docker Compose, Kubernetes, GitHub Actions, Ansible — while JSON remains the default for data exchanged between programs.
Frequently Asked Questions
Is this YAML to JSON converter free?
Yes, completely free with no sign-up and no limit on file size or usage.
Does it handle Docker Compose files with YAML anchors?
Yes. YAML anchors and << merge keys, commonly used in Docker Compose files to share common configuration between services, are resolved into their final merged values in the JSON output.
Does it handle multi-document Kubernetes manifests?
Yes. A YAML file containing multiple documents separated by --- (common when defining several Kubernetes resources in one file) is automatically converted into a JSON array of each document.
Why does my GitHub Actions "on:" key come out as "on" in quotes?
That's correct and intentional. In the older YAML 1.1 spec, unquoted words like on, off, yes, and no are interpreted as booleans. To avoid ambiguity, the converter quotes them when they're used as keys or values, which is exactly why you'll often see "on": in real GitHub Actions workflow files.
Is my data uploaded anywhere?
No. The conversion runs entirely in your browser using an open-source YAML library. Nothing you paste here is sent to a server.
Explore More Free Developer Tools
The YAML ⇄ JSON Converter is part of Texterfly's growing collection of free developer tools — no sign-up, nothing uploaded to a server.
Explore All Tools
134 free tools — no signup required
All 134 tools are free · No signup · No ads
