YAML ↔ JSON
Convert between YAML and JSON
About YAML and JSON
YAML and JSON are both human-readable data serialization formats. JSON is more compact and is the lingua franca of web APIs. YAML is more readable for configuration thanks to indentation-based structure and support for comments — it's the standard for Kubernetes manifests, GitHub Actions workflows, Ansible playbooks, and many CI configs.
Most YAML data converts losslessly to and from JSON, but a few YAML features (anchors, custom tags, multi-document streams) don't have a direct JSON equivalent. This converter handles the common subset.
Frequently asked questions
Are comments preserved in YAML → JSON?
No — JSON has no concept of comments, so they're stripped in conversion. Going JSON → YAML produces a clean YAML document without comments either, since the original JSON didn't have any.
What about multi-document YAML files?
Only the first YAML document in the input is converted. For multi-document streams (separated by
---), split them and convert each separately.