YAML Specification: The Configuration Language of Kubernetes & DevOps
Understand significant whitespace indentation, scalar types, multi-document streams, and converting YAML to JSON.
Format Specification & Header Signature
Core file signatures, developer metadata, and standard RFC specifications:
| Magic Bytes (Hex Signature) | 2D 2D 2D (---) |
| MIME Media Type | application/x-yaml, text/yaml |
| Standard / Specification | YAML 1.2 Specification (2009) |
| Initial Developer / Organization | Clark Evans, Ingy döt Net, and Oren Ben-Kiki (May 2001) |
| Specification Version | YAML 1.2.2 (Current) |
| Structure Representation | Indentation (spaces only; tabs prohibited) |
| Comments Support | Yes (lines prefixed with #) |
| Multi-Document Streams | Supported via triple dash (---) delimiters |
| JSON Compatibility | Strict superset of JSON 1.2 |
Operating System & Browser Compatibility Matrix
Where .yaml / .yml is natively supported without third-party codecs:
| Platform / Environment | Native Support | Implementation Notes |
|---|---|---|
| All Modern DevOps & Cloud Platforms | Supported | Standard configuration format for K8s, Docker, AWS CloudFormation, and CI/CD runners. |
Advantages of YAML Ain't Markup Language
- •Extremely readable syntax free of curly braces, double quotes, and semicolons
- •Full support for inline explanatory comments (#)
- •Supports complex data constructs including multi-line folded text (> and |) and reusable anchors (&)
- •Multi-document support in a single stream using --- dividers
Limitations & Trade-Offs
- •Indentation sensitivity: mixing 2 spaces with 4 spaces causes silent configuration failures
- •Tabs (\t) are strictly forbidden for indentation and cause parser aborts
- •Implicit type coercion traps (e.g. Norway country code `NO` parsed as boolean `false` in YAML 1.1)
The The Norway Problem: Implicit Type Coercion in YAML
A notorious quirk of the older YAML 1.1 specification was implicit boolean parsing: strings like `y`, `yes`, `true`, `on`, `n`, `no`, `false`, `off` were automatically cast to booleans. In country lists, `NO` (Norway) was routinely parsed as `false`!
YAML 1.2 resolved this by restricting boolean literals to `true` and `false`. However, explicitly quoting strings (`country: "NO"`) remains a recommended engineering practice.
Client-Side Tools for YAML Ain't Markup Language (.yaml / .yml)
Convert, optimize, or inspect .yaml / .yml files directly inside your browser with zero server uploads:
Frequently Asked Questions about YAML Ain't Markup Language
Can I use tabs for indentation in YAML files?
Never. The YAML specification strictly prohibits tab characters for indentation. You must always use spaces (typically 2 spaces per indentation level).
How do I convert a Kubernetes YAML manifest into JSON for API submission?
Use DocSwift's free client-side YAML to JSON converter to translate YAML manifests into valid JSON payloads instantly.