Converter

JSON to YAML Converter

Convert JSON into clean, readable YAML for Kubernetes, Docker Compose and CI pipelines, or turn YAML back into JSON.

How to use it

  1. Paste JSON or open a file. Use Sample to try a Kubernetes Deployment.
  2. The YAML updates as you type. Choose 2 or 4 spaces of indentation.
  3. Switch to YAML → JSON to go the other way. The current output becomes the new input.
  4. Copy the result or download it as data.yaml or data.json.

JSON vs YAML

YAML is a superset of JSON, designed for humans to read and edit. It uses indentation instead of braces, allows comments with #, and doesn't need quotes around most strings. That's why tools like Kubernetes, Docker Compose, GitHub Actions and Ansible use it for configuration. JSON is stricter and better for machines exchanging data over APIs.

Things to watch for

  • Strings that look like other types are quoted in the output. For example "yes", "no" and "12" become 'yes' and '12', so older YAML parsers don't read them as booleans or numbers.
  • Comments are lost when converting YAML to JSON, because JSON has no comments.
  • Multiple documents separated by --- are converted into a JSON array, one item per document.
  • Anchors and aliases (&default, *default) are expanded into full copies in the JSON.

Frequently asked questions

Is YAML a superset of JSON?

Yes. Any valid JSON document is also valid YAML 1.2, so YAML parsers can read JSON directly. Converting to YAML mainly makes it easier for people to read.

Why are some of my strings quoted in the YAML?

Values like yes, no, on, off or 12 would be read as booleans or numbers by some YAML parsers. Quoting keeps them as strings.

What happens to YAML comments?

JSON cannot hold comments, so they are dropped when converting YAML to JSON.

Can it convert a file with several YAML documents?

Yes. Documents separated by --- become items in a JSON array.

Is my data uploaded?

No. The conversion runs with JavaScript inside your browser tab. Nothing you paste or open is sent to a server or stored.