YAML to JSON
YAML ⇄ JSONConvert YAML to JSON and back, anchors and multiple documents included.
Result appears hereFull YAML 1.2: anchors and aliases are resolved, merge keys are applied, block scalars are preserved, and a multi-document file separated by --- becomes a JSON array. Try the sample to see the anchors expand.
About YAML to JSON
Convert YAML to JSON or JSON back to YAML. The usual reason to want this is a Kubernetes manifest, a CI pipeline, or a Docker Compose file that you need to inspect programmatically or paste into something that only speaks JSON.
This uses a full YAML 1.2 parser rather than a simplified one, and the difference shows up immediately on real configuration. Anchors and aliases are resolved, merge keys are applied so a shared block of defaults actually appears in each service that inherits it, block scalars keep their line breaks, and a file containing several documents separated by --- becomes a JSON array. A regex-based converter mishandles all of those, usually without saying so.
Both directions run in your browser. Configuration files are exactly the kind of thing that carries hostnames, bucket names and occasionally a secret, so it is worth knowing none of it is uploaded.
Common questions
This page does the work itself, in this tab. Nothing you paste is sent to a server. Close the tab and no copy remains.