JSON to YAML Converter

Convert in either direction — handy for Kubernetes manifests, GitHub Actions, Docker Compose and OpenAPI files.

Input · drop a file

Output

JSON and YAML are the same data

YAML 1.2 is a superset of JSON: every JSON document is valid YAML. Converting only changes the notation — braces and brackets become indentation and dashes. Comments cannot survive a YAML → JSON trip, because JSON has none.

Gotchas when converting YAML to JSON

  • Unquoted yes, no, on and off are strings in YAML 1.2 (this converter) but booleans in older YAML 1.1 parsers — quote them to be safe.
  • Values like 1.10 become the number 1.1. Quote version numbers.
  • A file with several --- documents becomes a JSON array.

Questions

Which direction does it convert?

Both. Use the JSON → YAML and YAML → JSON buttons.

Does it keep key order?

Yes, keys are written in the order they appear.

Related tools