What is YAML?
The Human-Friendly Config
More Than Just Markup
YAML (YAML Ain't Markup Language) is a data format designed to be easily read by humans. It uses indentation (spaces, not tabs!) to define structure, making it cleaner than JSON or XML. It's the standard for configuration files in modern DevOps tools like Docker and Kubernetes.
1. What's in a Name?
When it was first released in 2001, YAML stood for "Yet Another Markup Language".
But the creators soon realized that YAML wasn't really for "marking up" documents (like HTML); it was for data. So they changed it to a recursive acronym:
YAML Ain't Markup Language.
This cheekily emphasizes its purpose: data-oriented, strict, and designed for configuration rather than document presentation.
2. The Clean Syntax
YAML hates brackets. It uses indentation to show hierarchy.
YAML (Clean)
person:
name: John Doe
age: 30
skills:
- Coding
- DesignJSON (Noisy)
{
"person": {
"name": "John Doe",
"age": 30,
"skills": [
"Coding",
"Design"
]
}
}Critical Rule: You strictly CANNOT use tabs for indentation. Only spaces. Mixing tabs and spaces will cause the parser to fail immediately.
3. YAML vs JSON vs XML
| Format | Readability | Comments? | Usage |
|---|---|---|---|
| YAML | High (English-like) | Yes | Configs (Docker, K8s) |
| JSON | Medium (Brackets) | No | APIs, Web Data |
| XML | Low (Verbose Tags) | Yes | Legacy Enterprise, SOAP |
4. Use Cases
- Configuration: Because it supports comments, it's perfect for config files where you need to explain why a setting uses a certain value.
- DevOps Pipelines: GitHub Actions, GitLab CI, and Azure DevOps all use YAML to define build steps.
- Front Matter: Static site generators (like this blog!) often use a block of YAML at the top of markdown files to define metadata like title and date.
Work with Data Formats
Convert, format, or beautify your data securely in your browser.