YAML is easier to read; many tools and APIs only accept JSON. Paste a Kubernetes manifest, a Docker Compose file, a GitHub Actions workflow or an OpenAPI spec and get the same data as JSON. If the YAML has a mistake, such as wrong indentation or a tab, the error message says what is wrong.
Choose JSON → YAML (or press ⇄) to turn JSON into YAML.