YAML Cheat Sheet
Everything you need to know about YAML syntax — scalars, sequences, mappings, multi-line strings, anchors, and the type coercion gotchas that catch everyone.
Last updated: May 21, 2026
Find this tool useful? Support the project to keep it free!
Buy me a coffeeWhat is YAML Cheat Sheet?
YAML (YAML Ain't Markup Language) is a human-friendly data serialization format used extensively for configuration files (Docker Compose, GitHub Actions, Kubernetes, Ansible, etc.). It uses indentation for structure instead of brackets, making it readable but sensitive to whitespace.
This cheat sheet covers all YAML syntax: scalar types and their auto-detection, block and flow styles, multi-line string blocks, anchors (`&`) and aliases (`*`), and the notorious type coercion pitfalls that cause unexpected parse results.
How to Use YAML Cheat Sheet
Common Use Cases
- DevOps engineers writing Kubernetes manifests, Docker Compose, or Ansible playbooks.
- Developers configuring GitHub Actions workflows who need YAML syntax reminders.
- Students learning YAML who want a structured reference alongside JSON.
- Engineers debugging YAML parse errors caused by indentation or type coercion.
Example Input and Output
YAML mapping demonstrating key scalar types and sequences.
name: Alice
age: 30
active: true
tags:
- admin
- user
address:
city: London{"name":"Alice","age":30,"active":true,"tags":["admin","user"],"address":{"city":"London"}}Tip: use a validator
YAML indentation errors are hard to spot visually. Paste your YAML into the YAML Validator to get the exact line of the parse error.

