TheJSON

JSON to YAML

Convert JSON to clean, correctly quoted YAML for Kubernetes manifests, GitHub Actions, or config files.

About the conversion

Strings that YAML would otherwise misread, such as yes, no, null, numbers, or values starting with special characters, are automatically double-quoted so the YAML round-trips to the same JSON. Everything else is emitted as plain scalars for readability, with two-space indentation and block-style sequences.

When to convert JSON to YAML

  • Turning an API example or an exported resource into a Kubernetes manifest or Helm values file.
  • Moving configuration from a JSON file into a GitHub Actions, Docker Compose or CI pipeline definition.
  • Making a long JSON document easier to review in a pull request.

Like every tool on TheJSON, this runs entirely in your browser. Nothing you paste is uploaded, logged or stored on a server, so it is safe to use with API responses that contain tokens or customer data.

Frequently asked questions

Will the YAML parse back to the same JSON?

Yes. Ambiguous strings such as "yes", "1.0" or "2024-01-01" are quoted so YAML parsers keep them as strings rather than booleans, numbers or dates.

Are comments preserved?

JSON has no comments, so there is nothing to carry over. Add comments to the YAML afterwards; they are one of the main reasons to prefer YAML for configuration.

Which YAML version is produced?

Plain YAML 1.2 using only block collections and scalars, which every parser (PyYAML, js-yaml, Go yaml, Kubernetes) accepts.

Related JSON tools