JSON to YAML
Convert a JSON document into readable YAML.
Everything runs inside your browser. Your files never leave your device.
Input
Result
Ask about JSON to YAML
Questions about what this tool does, which option to pick, or what it can and cannot handle.
This is the one part of the site that uses a server. The question you type here is sent to an AI provider to be answered — your files and whatever you put in the tool above are not, and the assistant cannot see them. Answers are generated and can be wrong; the tool itself is not guessing.
About the JSON to YAML
YAML is what people write and JSON is what machines emit, which is why this conversion comes up constantly. You have an API response, a Terraform output or a package manifest in JSON, and you need it in a Kubernetes manifest, a GitHub Actions workflow or a Docker Compose file.
The conversion is mostly mechanical — YAML is a superset of JSON — but there is one trap worth knowing about, and this tool gives you a switch for it. YAML's older type inference reads the bare words “yes”, “no”, “on”, “off”, “y” and “n” as booleans. A JSON string of “"no"” becomes a bare “no” in YAML, and some parsers will then hand your program a boolean “false”. Country code “NO”, the answer to a survey question, a two-letter product code: all of them can flip type on the way through. Turning on "Always quote strings" prevents it at the cost of a slightly noisier document.
The tool also disables line wrapping, so long strings and URLs stay on one line rather than being folded across several — folded scalars are valid YAML but they are miserable to diff and easy to mis-edit.
Indentation is yours to choose, and the whole conversion happens inside your browser.
How to use it
- 1Paste your JSON document into the input box.
- 2Pick two-space or four-space indentation to match the file you are pasting into.
- 3Turn on “Always quote strings” if any of your values are words like yes, no, on or off.
- 4Copy the YAML, or download it as a .yaml file.
Questions
- Is the conversion lossless?
- For data, yes — every JSON document is representable in YAML. What does not survive is formatting: comments cannot exist in the JSON source to begin with, and key order is preserved but has no meaning in either format.
- Why would I quote every string?
- Because YAML 1.1 parsers read yes, no, on, off, y and n as booleans, and some read a leading-zero number as octal. Quoting removes all of that inference. If your data contains none of those values, leave it off for a cleaner file.
- Which YAML version does it produce?
- Output follows YAML 1.2, which is what modern parsers expect. The quoting option exists because plenty of tooling in the wild still behaves like YAML 1.1.
- Can it convert back?
- Yes — the YAML to JSON tool does the reverse, and the two round-trip cleanly.
