YAML (YAML Ain't Markup Language) is a human-readable data serialization format that uses indentation-based structure instead of brackets or tags. It is widely used for configuration files in DevOps, CI/CD pipelines, and application settings.
YAML is a data serialization language designed specifically to be human-friendly. Unlike JSON and XML which use structural delimiters (brackets, braces, tags), YAML relies on whitespace indentation to denote structure. This makes YAML files clean and readable at a glance, especially for configuration files that humans edit directly.
YAML uses indentation (spaces, not tabs) to define hierarchy. Dashes (-) denote list items, key-value pairs are written as key: value, and multi-line strings use | (literal block) or > (folded block). YAML supports advanced features like anchors (& and *) for reusing content, data types without quotes, and multi-document files separated by ---.
YAML originally stood for Yet Another Markup Language, but was later redefined as YAML Ain't Markup Language to emphasize that it is a data format, not a markup language.
YAML requires spaces for indentation. Tabs are not allowed and will cause parsing errors. Always use 2 spaces per indentation level.
YAML is more human-readable with indentation-based syntax, supports comments, and offers advanced features like anchors. JSON is stricter, more widely supported across all languages, and faster to parse.