About this JSON to YAML converter
YAML holds the same data as JSON but uses indentation instead of braces and brackets, which makes it easier to read and edit by hand. That is why Kubernetes manifests, Docker Compose files, GitHub Actions workflows, and many app configs use it. This converter parses your JSON strictly, pointing to the exact line and column of any mistake, then writes block-style YAML. Strings are quoted only when they need to be, including words like yes, no, on, and off that older YAML parsers would read as true or false. Multi-line strings become literal blocks, and key order is kept.
How to convert JSON to YAML
- Add your JSON. Paste JSON, open a .json file, or press an example such as Kubernetes or Docker Compose.
- Choose the format. Pick 2 or 4 spaces, decide whether short lists stay on one line, and add the --- marker if your tool expects it.
- Press Convert to YAML. Copy the YAML or download it as a .yaml file. If the JSON has an error, the line is shown with a caret under the problem.
Frequently asked questions
Is YAML a superset of JSON?
Mostly. YAML 1.2 can read almost any JSON document as it is, but the block style produced here is the more readable form people usually write by hand.
Why are some strings in quotes?
Values that YAML could read as something else stay quoted, such as "yes", "123", or "null" when they are text, and strings that start with special characters like - or *. Plain words are left unquoted.
Does the conversion keep the order of keys?
Yes. Keys appear in the same order as in your JSON, so the YAML stays easy to compare with the original.
Should I use 2 or 4 spaces?
Two spaces is the common choice for Kubernetes, Docker Compose, and GitHub Actions. Both are valid YAML; just do not mix tabs in, because YAML does not allow tabs for indentation.
How are multi-line strings converted?
Strings with line breaks become literal blocks starting with | or |-, so each line appears on its own line in the YAML and the breaks are kept exactly.