JSON to YAML

Convert JSON data to YAML configuration format.

Convert JSON to YAML, the indentation-based format used by Kubernetes, Docker Compose, GitHub Actions and many config files. Paste JSON and get clean YAML with 2 or 4-space indentation, optionally with keys sorted alphabetically. Strings that YAML would misread, such as "yes", "1.0" or values with colons, are quoted automatically. Long strings aren't folded, so values stay on one line. It runs in your browser with js-yaml.

Common use cases

  • Turn a JSON API example into a YAML config
  • Convert an OpenAPI spec from JSON to YAML
  • Write Kubernetes or Compose files from JSON output
  • Make JSON easier to read and comment

How to use

  1. Paste the JSON.
  2. Choose the indent and whether to sort keys.
  3. Copy or download the YAML.

FAQ

Why are some values in quotes?

Without quotes, YAML would read them as another type (yes as a boolean, 1.0 as a number) or misread a colon. Quotes keep them as strings.

Is YAML a superset of JSON?

Almost: valid JSON is nearly always valid YAML. Converting gives you YAML's more readable style.

Can I check the result?

Yes. Paste it into the YAML validator.