JSON to YAML Converter
Convert JSON to YAML as you type.
How to convert JSON to YAML
- Paste or type JSON into the left box. The YAML appears on the right as you type.
- Choose an indent of 2 or 4 spaces. YAML does not allow tabs for indentation, so there is no tab option.
- Select Copy or Download to save the result as
converted.yaml. - Use Swap to open the YAML to JSON converter with your YAML already filled in.
If the JSON is invalid, the status line shows the line and column of the first error, such as a trailing comma or a missing quote. The conversion runs in your browser, so your data is never uploaded.
Example
This JSON:
{"server":{"host":"localhost","port":8080},"debug":true,"tags":["api","v2"]}becomes this YAML:
server:
host: localhost
port: 8080
debug: true
tags:
- api
- v2Frequently asked questions
Why convert JSON to YAML?
YAML is easier to read and edit by hand, and it is the format of Kubernetes manifests, Docker Compose files, GitHub Actions workflows and many application configs. Converting lets you take JSON from an API or a generator and drop it into one of those files.
Will the YAML mean exactly the same as my JSON?
Yes. YAML 1.2 is a superset of JSON, so every value keeps its type. Strings that YAML would read as another type, such as "true", "42" or "yes: no", are quoted so they stay strings.
Does key order change?
No. Keys are written in the order they appear in the JSON, and arrays keep their order. Long strings are not wrapped, and strings with line breaks become YAML block scalars.