JSON to YAML Converter

Paste JSON to get clean YAML, or switch direction to turn YAML into JSON. The result updates as you type.

Runs in your browser. Nothing is uploaded.
or paste below, or drop a file onto the box

Report a problem with this tool

How to convert JSON to YAML

  1. Paste your JSON into the left box, open a .json file, or drop one onto the box.
  2. The YAML appears on the right straight away. Pick 2 or 4 spaces of indent, and tick Sort keys if you want the keys in alphabetical order.
  3. Copy the YAML or download it as a .yaml file.

To go the other way, choose YAML to JSON at the top and paste your YAML.

JSON and YAML

YAML and JSON can hold the same data: objects, lists, text, numbers, true and false, and null. JSON uses braces, brackets and quotes, which suits programs and APIs. YAML uses indentation and dashes instead, which makes it easier for people to read and edit, so it's common in config files for Docker Compose, Kubernetes, GitHub Actions and OpenAPI.

When converting YAML to JSON, comments are dropped because JSON has no way to store them. Anchors and aliases (&name and *name) are expanded into full copies of the data they point to.

Frequently asked questions

Is my data uploaded?

No. The conversion runs in your browser, so config files with passwords or keys stay on your device.

Why are some values in quotes in the YAML?

Text that YAML would otherwise read as something else is quoted to keep it as text. For example "yes", "no", "on" and "1.0" are quoted so they don't turn into true, false or a number when the YAML is read back.

What happens with a YAML file that has several documents?

If the YAML holds more than one document separated by ---, the JSON output is a list with one item per document.

What does the error message mean?

It shows the line and column where the input stopped making sense. Look for a missing comma or quote in JSON, or a line indented with the wrong number of spaces in YAML.

More free tools