YAML and JSON Converter
YAML
JSON
ExampleAbout
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.
How to use
1.
Choose YAML → JSON or JSON → YAML
2.
Paste your YAML or JSON into the input panel - it converts as you type
3.
Copy or download the result, or press Swap to convert it back
Common uses
▸
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
Similar tools
Frequently asked questions
Can it convert multi-document YAML files?
Yes. A file with several documents separated by --- lines, as is common for Kubernetes manifests, converts to a JSON array with one element per document; empty documents are skipped. Converting that array back gives a single YAML document containing a list, not separate --- documents.
Are dates converted to timestamps?
No. An unquoted date such as 2024-01-15 stays the same text in the JSON rather than becoming a timestamp like 2024-01-15T00:00:00.000Z. In the other direction, strings that look like dates, numbers or booleans are quoted in the YAML so other parsers keep them as strings.
What happens with comments, anchors and merge keys?
Anchors (&), aliases (*) and merge keys (<<) are resolved during parsing, so the resulting JSON contains the expanded values. Comments (lines starting with #) are dropped, because JSON has no comment syntax.
What indentation does the YAML output use?
Output uses 2-space indentation, the most common YAML convention, and long strings are kept on one line rather than folded.
Is my data sent to a server?
Conversion runs entirely in your browser using the js-yaml library. No data is transmitted anywhere.