JSON to YAML Converter
Turn JSON into readable YAML for Kubernetes, Docker Compose or a CI pipeline, instantly and privately.
Convert JSON to YAML Online
JSON is what APIs return and what programs write; YAML is what people edit. Kubernetes manifests, Docker Compose files, GitHub Actions workflows and Ansible playbooks are all YAML, so a JSON snippet from documentation or an API response often has to be rewritten before it can be used. This page is the JSON Converter set to JSON input and YAML output.
The conversion is instant and happens in the page, which matters for configuration that contains hostnames, tokens or passwords.
What changes between the two
| JSON | YAML |
|---|---|
{"port": 8080} | port: 8080 |
["a", "b"] | One - item per line |
| Braces and brackets show nesting | Indentation shows nesting |
| No comments | Comments start with # |
Indentation
YAML is sensitive to indentation, and projects tend to settle on one width. The Indent menu writes 2 or 4 spaces per level; 2 is the most common choice for Kubernetes and Compose files. Tabs are not allowed for indentation in YAML, so the Tab option is written as 2 spaces when the output is YAML.
Strings that need quotes
The trickiest part of YAML is implicit typing. In older YAML 1.1 parsers, a bare no is false, 1.10 is the number 1.1 and 2024-01-01 is a date. A country code or a version number can silently change type that way. The converter quotes every string that could be misread, so "no" in your JSON stays the string no in YAML.
Going the other way
To turn a YAML file back into JSON, use YAML to JSON, or press the swap button on this page. For a table instead of a document, JSON to CSV flattens the records into columns.