YAML Formatter & Validator
What is YAML?
YAML (“YAML Ain’t Markup Language”) is a human-readable data serialization format widely used for configuration files. It uses indentation to represent structure instead of braces or tags, making it more readable than JSON or XML for configuration data.
YAML is the standard format for Docker Compose, Kubernetes manifests, GitHub Actions, CI/CD pipelines (GitLab CI, CircleCI, Azure Pipelines), Ansible playbooks, and many other DevOps and infrastructure tools.
YAML vs JSON
YAML is a superset of JSON — every valid JSON document is also valid YAML. YAML adds features like comments, multi-line strings, anchors/aliases, and more readable syntax. Use JSON for APIs and data exchange; use YAML for configuration files where humans edit the data directly.
Common YAML Pitfalls
- Indentation: YAML uses spaces, never tabs. Inconsistent indentation is the #1 cause of YAML errors.
- Implicit typing: Values like
yes,no,on,offare interpreted as booleans. Quote them if you mean strings. - Colons in values:
key: value: with: colonsmay break. Quote the value. - Special characters: Values starting with
*,&,!,%,@need quoting.