Three formats for the same data
JSON is what APIs send and JavaScript reads. YAML is what people write by hand in configuration files for Docker Compose, Kubernetes, GitHub Actions or Ansible. XML is still everywhere in feeds, invoices, Office files and older web services. They all describe the same kind of data: objects, lists, text, numbers and true or false, so they can be converted into each other.
Some details do not survive every trip. Comments in YAML and XML are dropped, because JSON has no comments. XML has no lists or numbers of its own, so repeated elements become arrays and numbers are recognized only if you turn that on. Each direction below explains what happens to such cases.
A real YAML parser, not a shortcut
YAML has many rules that simple converters get wrong: block text with | and >, quoted and unquoted text, anchors (&name) and aliases (*name), merge keys (<<) and several documents in one file, each starting with a line of three hyphens. This tool uses a complete YAML parser that follows the YAML 1.2 specification, and it limits alias expansion so that a hostile file cannot freeze your browser.