# sigs.k8s.io/yaml

> Marshal Go structs to and from YAML using their JSON tags

Source: https://talira.ai/catalog/sigs-k8s-io-yaml-vgvmt632
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Library
- Categories: [libraries / serialization](https://talira.ai/categories/libraries/serialization), [languages / go](https://talira.ai/categories/languages/go)
- Licence: MIT AND BSD-3-Clause[^2]
- Pricing: Free and open source[^1]
- Free tier: yes[^1]
- Backed by: [Kubernetes SIG API Machinery](https://talira.ai/orgs/kubernetes-sig-api-machinery.md)
- Forked from [ghodss/yaml](https://talira.ai/catalog/ghodss-yaml-kwfw6bdt.md).

sigs.k8s.io/yaml is an open source Go library from the Kubernetes project for marshalling and unmarshalling YAML. It wraps go-yaml: it converts YAML to JSON and then uses the standard library's json.Marshal and json.Unmarshal, so a struct's existing JSON field tags and custom JSON methods apply to YAML too. It's a permanent fork of ghodss/yaml, maintained under Kubernetes SIG API Machinery.

## Links

- GitHub: https://github.com/kubernetes-sigs/yaml
- Docs: https://pkg.go.dev/sigs.k8s.io/yaml

## Problems it solves

- parse YAML into Go structs using their json tags
- read Kubernetes-style YAML config into Go types
- convert YAML to JSON in Go

## Features

- marshal and unmarshal YAML with a struct's JSON tags
- reuses custom JSON marshalling methods for YAML
- YAMLToJSON and JSONToYAML conversion
- supports everything go-yaml supports

## Limitations

- Binary data must not be tagged !!binary, or it's decoded to native binary and then wrongly re-encoded[^1]
- Maps whose keys are maps fail, since JSON doesn't support them[^1]

## Trust

Overall: 0.33 out of 1.
Signals: maintenance 0.27, adoption 0.51, momentum 0.20, community 0.64, backing 0.30, extensibility 0.00.

- latest release v1.6.0 16 months ago
- 355 GitHub stars
- 39 contributors
- backed by Kubernetes SIG API Machinery

Warnings:

- last commit 11 months ago

## Related

- Based on [go-yaml (yaml/go-yaml)](https://talira.ai/catalog/go-yaml-yaml-go-yaml-x2bj0gc4.md)

## Alternatives

- [ghodss/yaml](https://talira.ai/catalog/ghodss-yaml-kwfw6bdt.md): Go YAML marshaling that reuses JSON struct tags, by converting YAML to JSON (unmaintained)

## Sources

[^1]: https://github.com/kubernetes-sigs/yaml/blob/master/README.md (checked 28 Nov 2026)
[^2]: https://github.com/kubernetes-sigs/yaml/blob/master/LICENSE (checked 28 Nov 2026)
