JSON to YAML converter

Turn JSON into readable YAML in one step.

Runs in your browser. Nothing you type is sent anywhere.

How to convert JSON to YAML

  1. Paste or upload your JSON.
  2. The YAML appears as you type.
  3. Copy it or download the .yaml file.

What changes from JSON to YAML

  • Curly braces and commas disappear. Indentation shows the structure instead.
  • Property names lose their quotes, unless a name contains a character YAML needs to quote, such as a colon.
  • A JSON array becomes a list of dashed lines, one per item, indented under its key.
  • true, false and null are written the same word in both formats.

Why some YAML values keep their quotes

JSON valueWritten asReason
"007"'007'Bare 007 would read as the number 7
"yes"'yes'Some YAML readers treat bare yes or no as a boolean
"null"'null'Bare null would parse as the null value
"2024-01-01"'2024-01-01'Bare dates parse as a date type in some readers

Where YAML shows up

  • Docker Compose files
  • Kubernetes manifests
  • GitHub Actions workflow files
  • Ansible playbooks

Where JSON to YAML helps

  • Turning an exported settings file into the config format your deployment tool actually reads.
  • Making an API response easier to scan at a glance before diffing two versions of it.
  • Drafting a values file for a Helm chart or similar tool from existing JSON data.

JSON to YAML FAQ

Why use YAML instead of JSON?

YAML drops most brackets and quotes and uses indentation instead, so config files for tools like Docker Compose, Kubernetes and GitHub Actions are easier to read and edit by hand.

Why are some values wrapped in quotes?

Strings that YAML would otherwise read as something else keep their quotes. For example '007' stays text instead of becoming the number 7, and 'yes' stays a string.

Can I add comments to the YAML?

JSON has no comments, so there are none to carry over. You can add your own with a # after converting.

Which YAML dialect does this write?

Standard YAML 1.2, produced by js-yaml, the same library many Node.js build tools use to read and write config files.

Does it keep the order of keys?

Yes. Keys are written in the same order they appear in the JSON object, so a diff between the two stays easy to follow.

Can I convert a JSON array at the top level?

Yes. A top-level array becomes a YAML sequence of dashed items instead of a mapping of keys and values.

Does it handle deeply nested objects and arrays of objects?

Yes. Nesting of any depth converts correctly, with each level indented 2 spaces further than its parent, which is js-yaml's default style.

What happens to a value containing a colon, like a time or a URL?

The whole value gets wrapped in quotes, since an unquoted colon followed by a space would otherwise look like the start of a new key.

Related tools