YAML ("YAML Ain't Markup Language") is a human-readable data serialization format that uses indentation and minimal punctuation to represent nested structures, instead of JSON's braces and brackets. Since YAML 1.2 (2009), every valid JSON document is also valid YAML, but YAML adds comments, unquoted strings, multi-document files, and a much terser nested syntax — which is why it's the default format for tools like Docker Compose, Kubernetes manifests, GitHub Actions, and Ansible.
Structure is defined by indentation (spaces only — YAML forbids tabs) rather than explicit delimiters:
apiVersion: v1
kind: Pod
metadata:
name: web
labels:
app: frontend
spec:
containers:
- name: nginx
image: nginx:1.27
ports:
- containerPort: 80
Lists are marked with a leading -; maps are key: value pairs; comments start with #. YAML also supports anchors (&name) and aliases (*name) to reuse a block of config elsewhere in the same document without duplicating it, and --- separates multiple documents within a single file — both features JSON has no equivalent for.
no, yes, on, off, and country code NO (Norway) are interpreted as booleans rather than strings — YAML 1.2's core schema fixed this, but many real-world parsers (including older PyYAML defaults) still follow 1.1 rules, so quoting ambiguous-looking strings is the safe habit.