How it works
YAML describes structure with indentation, while JSON uses braces and brackets. This converter parses the YAML subset used in everyday infrastructure files into plain data (objects, arrays, strings, numbers, booleans and null) and writes it out as JSON, or does the reverse using the standard JSON parser and a small YAML writer.
It deliberately refuses what it cannot read faithfully: tabs for indentation, duplicate keys, anchors and aliases, tags, and multiple documents. That way you get a clear message with a line number instead of a silently wrong result. Comments are lost in conversion because JSON cannot hold them.
Common uses
- Turning a docker-compose.yml or Kubernetes manifest into JSON for an API call or a script.
- Writing a JSON policy or config and converting it to YAML for a CI or Helm values file.
- Spotting indentation mistakes: a YAML file that will not convert usually will not deploy either.
- Quickly checking what type a YAML value really has once it is parsed.
