Turn JSON into YAML keeping the key order. It is what you need when a configuration you hold as JSON has to go inside a docker-compose, a Kubernetes manifest or a CI workflow.
The output avoids anchors and references, so it is readable and can be pasted as-is even where structures repeat.
How to use it
- Paste the JSON.
- Adjust the indentation if your project uses another.
- Copy the YAML.
Frequently asked questions
- What indentation should I pick?
- Two spaces is the majority convention and what Docker Compose and Kubernetes use. YAML never allows tabs.
- Why are some strings quoted and others not?
- YAML only needs quotes when a value could be mistaken for another type: “true”, “null”, “1.0” or a string starting with a special character.
- Is the key order kept?
- Yes, the output follows the order of the input JSON.
Related tools
JSON to CSVAn array of objects into a table, flattening nested objects.
CSV to JSONDetects the separator, respects quotes and types the values.
YAML to JSONTakes files with several documents in them.
Format and validate JSONIndent, minify or sort keys, and get the error’s line and column.
Decode a JWTHeader, payload and expiry. The signature is not verified.