Convert JSON to YAML

Paste JSON and get YAML. Errors show the line and column. Nothing leaves your browser.

JSON is what an API returns, and YAML is what many tools expect as a config file: Kubernetes manifests, GitHub Actions workflows, Docker Compose files and OpenAPI specs are all written in it. This page opens in the JSON to YAML direction with a short sample already converted. Objects become indented keys, lists become lines that start with a dash, and null stays null. Text that holds a line break becomes a block with a pipe so it stays readable. Strings that could be mistaken for another type, such as the text true or 123, are put in quotes, so reading the YAML back gives the same values. If the JSON has a mistake, such as a comma after the last item, the page names the line and column instead of guessing. JSON has no comments, so there is nothing to carry over, and you can add your own comments to the YAML afterwards.

How it works

  1. Paste JSON or YAML
  2. Choose the direction and the indent
  3. Copy the converted text

Frequently asked questions

Will the YAML read back as the same data?

Yes for plain data. Strings that look like numbers, booleans or null are quoted, so the type stays the same when a YAML reader loads the file. Key order is kept.

What does the error with a line and column mean?

The JSON is not valid at that spot, for example a trailing comma or single quotes. The message says what to change. Fix it there and the YAML appears at once.

Can I choose the indent?

Yes, 2 or 4 spaces. Most Kubernetes and CI files use 2. YAML does not allow tabs for indentation, so there is no tab option on this page.