JSON to YAML converter
Simply convert JSON to YAML with this online live converter.
About JSON to YAML converter
Converts JSON into YAML as you type. YAML is the format of most configuration files (Kubernetes, GitHub Actions, Docker Compose, Ansible), and this tool lets you write or paste JSON and get an equivalent YAML document.
When you would use it
- Turning a JSON config or API response into a YAML manifest or workflow file.
- Checking how a JSON structure looks in YAML before hand-editing a long configuration file.
- Converting JSON test fixtures into the YAML a tool such as Ansible or Helm expects.
How to use it
- Paste JSON into the left field. Relaxed JSON5 syntax (comments, trailing commas, unquoted keys) is accepted.
- Read the YAML on the right; it updates on every change.
- Copy the result with the copy button.
Things worth knowing
- Comments in the JSON5 input are dropped: the converter works on the parsed data, not the text.
- Strings that YAML would read as another type, such as "true", "null" or a number written as a string, are quoted automatically so their meaning is preserved. Words like yes and no are plain strings in YAML 1.2 and stay unquoted.
- Output uses two-space indentation and block style. Long strings containing spaces may be folded onto several lines, which is valid YAML but can look surprising.
- Key order is preserved. JSON has no comments, anchors or multiple documents, so none appear in the output.
Frequently asked questions
- Why are some of my strings quoted and others not?
- YAML only needs quotes when a bare value would be interpreted as something else, for example the string "true" or "1.0". The converter adds quotes exactly in those cases.
- Can I convert YAML back to JSON?
- Yes, use the YAML to JSON converter. Converting back and forth preserves the data, but not comments or formatting.