How to Convert JSON to YAML (and Why Config Files Use It)

By Daniel · Updated July 2026

JSON is the language of APIs; YAML is the language of config files. They hold the same kind of data — objects, lists, values — but YAML drops the braces and quotes in favour of indentation, which makes hand-written config far easier to read. Converting between them is a routine part of DevOps work.

The one rule that breaks YAML

YAML uses spaces, never tabs, and indentation is significant — the number of spaces defines the structure. A single stray tab or a misaligned line changes the meaning or throws a parse error. When you convert from JSON you sidestep this entirely, because the converter produces correct, consistent indentation for you.

How to convert

  1. Open the JSON to YAML converter and paste valid JSON.
  2. Copy the YAML output into your config file.
  3. It runs in your browser, so a config full of secrets or hostnames never leaves your machine.

Where YAML shows up

If you work with Docker Compose, Kubernetes, GitHub Actions, or most CI systems, you are writing YAML. Converting a known-good JSON object to YAML is a reliable way to get the syntax right the first time instead of fighting indentation errors.

Keep quotes around values that look like something else — yes, no, on, off and version numbers like 1.10 can be misread by YAML unless quoted. A good converter quotes these for you.

JSON to YAML Converter
Paste JSON and get clean YAML back, converted in your browser.
Open the tool →

Common questions

Is YAML just JSON without brackets?

Almost — YAML is a superset of JSON, so any JSON is already valid YAML. The reverse is not always true because YAML has extra features.

Why does my YAML break?

Nearly always indentation: a tab where spaces are required, or a line indented by the wrong number of spaces.

Is my data uploaded?

No. The conversion runs entirely in your browser.

Can I convert YAML back to JSON?

Yes, the process reverses cleanly since the two formats hold the same structure.

Keep reading

How to Format Messy JSON · How to Convert CSV to JSON · How to Convert JSON to CSV