YAML and JSON Converter
YAML is a human-friendly data serialization format commonly used for configuration files in tools like Kubernetes, Docker Compose, and GitHub Actions. Unlike JSON, YAML supports comments, multi-line strings, and relies on indentation rather than braces, making it easier to read and edit by hand.
1.
Paste YAML or JSON into the Input panel
2.
Click the direction you want to convert
3.
Copy or download the result
▸
Converting Kubernetes or Docker Compose configs between YAML and JSON
▸
Transforming a JSON API response into YAML for a config file
▸
Reading dense JSON as YAML when the format is more human-friendly
Are all JSON documents valid YAML?
JSON is technically a subset of YAML, so valid JSON is also valid YAML. The reverse is not true: YAML supports features like comments and multi-line strings that JSON does not.
Does YAML support comments?
YAML supports comments (lines starting with #), but JSON does not. Comments are lost when converting YAML to JSON.
Is my data sent to a server?
Conversion runs entirely in your browser using the js-yaml library. No data is transmitted anywhere.
What indentation does the YAML output use?
Output uses 2-space indentation, which is the most common YAML convention.
What happens with YAML anchors and aliases?
Anchors (&) and aliases (*) are resolved during parsing, so the resulting JSON contains the expanded values rather than the anchor references.