YAML to JSON converter
Convert between YAML and JSON formats
YAML / JSON Converter
Convert between YAML and JSON formats
TL;DR
What is YAML to JSON converter?
YAML (YAML Ain't Markup Language) is a human-readable data serialization format commonly used for configuration files (Docker Compose, Kubernetes manifests, GitHub Actions). JSON is the standard for API data interchange. Converting between them is common when a tool requires one format but your source is in the other.
Common use cases
- ‣Kubernetes and Docker: convert JSON API output back to YAML for use in manifests
- ‣CI/CD pipelines: translate between YAML config files and JSON-based tooling that does not parse YAML
- ‣API exploration: paste a YAML config into a JSON validator or diff tool
- ‣Config migration: move configuration from a YAML-based system to a JSON-based one or vice versa
Frequently asked questions
What can YAML express that JSON cannot?
YAML supports comments, multiline strings, anchors and aliases (for reusing values), and a more relaxed syntax (unquoted strings, indentation-based structure). JSON is a strict subset of YAML 1.2 but not of YAML 1.1.
Why does converting YAML to JSON sometimes lose information?
YAML comments are discarded on conversion because JSON has no comment syntax. YAML anchors and aliases are resolved into their expanded values. These are inherent limitations of the JSON format, not bugs in the converter.
See also
- ‣JSON formatter: format and validate the resulting JSON after converting from YAML to confirm the structure is correct
- ‣JSON diff: compare two YAML-derived JSON objects to find exactly what changed between two versions of a config