WebTools

JSON to YAML

A straight conversion that keeps the key order.

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

  1. Paste the JSON.
  2. Adjust the indentation if your project uses another.
  3. 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