What Is YAML?
YAML (YAML Ain't Markup Language) is a human-readable data serialisation format. It's designed to be easy to read and write by humans while remaining simple for machines to parse.
YAML is the dominant configuration format in the DevOps ecosystem - used by Docker Compose, Kubernetes, GitHub Actions, Ansible, and many CI/CD tools.
YAML Syntax Basics
Key-Value Pairs
name: DailyUtil
version: 1.0.0
description: Free developer tools
Nested Objects (Indentation)
database:
host: localhost
port: 5432
name: dailyutil_db
YAML uses spaces for indentation (never tabs). The standard is 2 spaces per level.
Lists (Arrays)
tools:
- JSON Viewer
- Base64 Encoder
- JWT Decoder
- UUID Generator
Inline Syntax
tools: [JSON Viewer, Base64 Encoder, JWT Decoder]
config: {host: localhost, port: 5432}
YAML Data Types
| Type | Example |
|---|---|
| String | name: DailyUtil |
| Number | port: 5432 |
| Boolean | enabled: true |
| Null | value: null or value: ~ |
| Date | created: 2026-05-14 |
Multiline Strings
Literal block (|) - preserves newlines:
description: |
This is line one.
This is line two.
Folded block (>) - joins lines with spaces:
description: >
This is a very long
description that wraps
across multiple lines.
YAML vs JSON
| Feature | YAML | JSON |
|---|---|---|
| Readability | ✅ Very human-friendly | ⚠️ More verbose |
| Comments | ✅ # comment | ❌ Not supported |
| Data types | ✅ Dates, multiline strings | ❌ Strings, numbers only |
| Complexity | ⚠️ Anchors, aliases | ✅ Simple |
| Use case | Config files | APIs, data exchange |
Common YAML Mistakes
- Using tabs - YAML only allows spaces for indentation
- Unquoted special strings -
yes,no,on,offare parsed as booleans. Use quotes:"yes" - Inconsistent indentation - mixing 2-space and 4-space indentation causes parse errors
- Forgetting colons in nested keys -
key valueinstead ofkey: value - Norway problem - the country code
NOis parsed as booleanfalse. Always quote:"NO"
Where Is YAML Used?
- Docker Compose -
docker-compose.yml - Kubernetes - pod, deployment, service manifests
- GitHub Actions -
.github/workflows/*.yml - Ansible - playbooks and inventory
- CI/CD - GitLab CI, CircleCI, Travis CI
View and Validate YAML
Use our YAML Viewer & Formatter to parse, format, and explore YAML documents with tree navigation - all in your browser.

