JSON to YAML

Convert JSON to YAML.

Loading…

YAML holds the same data as JSON in a form that is easier to read and to edit by hand: no braces, few quotes, structure shown by indentation. It is the format of Docker Compose, Kubernetes and GitHub Actions.

Paste JSON and the YAML appears below. Strings that could be mistaken for numbers or booleans are quoted automatically so their meaning does not change.

How to use the JSON to YAML tool

  1. Paste the JSON or open the file that holds it.
  2. Choose two or four spaces of indentation.
  3. Copy or download the YAML.
  • Writing Kubernetes and Docker Compose files
  • Turning an API response into a config file
  • Front matter for static site generators

Tips for the best result

  • YAML forbids tabs for indentation; the output uses spaces only.
  • Keep a copy of the JSON if other tools still need it.

Quick facts

PriceFree
Works withText
Where it runsIn your browser, on your device
AccountNot needed

Frequently asked questions

Is any information lost?

No. Every JSON value has an exact YAML form.

Why are some strings quoted and others not?

Quotes are added only where a bare word would be read as a number, a boolean or null.

Which YAML version is written?

Output that both YAML 1.1 and 1.2 parsers read the same way.

Can I add comments?

JSON has none to carry over. Add them in the YAML afterwards with a # sign.