YAML Formatter and Validator
Format, beautify, validate, and minify YAML online. Clean up messy indentation and check syntax. Free, client-side, no data sent to any server.
What is YAML?
YAML (YAML Ain't Markup Language) is a human-readable data serialization format used extensively for configuration files. It relies on indentation to define structure, making it cleaner than JSON or XML for files that humans frequently read and edit.
Common uses for YAML
- Kubernetes: Pod specs, deployments, services, ConfigMaps, and Helm charts.
- Docker Compose: Multi-container application definitions.
- CI/CD pipelines: GitHub Actions, GitLab CI, CircleCI, and Azure Pipelines.
- Ansible: Playbooks, roles, and inventory files.
- Application config: Spring Boot, Ruby on Rails, Hugo, and many frameworks.
YAML formatting best practices
- Use 2-space indentation: This is the most common convention and keeps nesting manageable.
- Never use tabs: The YAML spec forbids tab characters for indentation.
- Quote strings when ambiguous: Values like "true", "null", "1.0", or strings with special characters should be quoted.
- Use consistent list style: Choose either block style (- item) or flow style ([item1, item2]) and be consistent.
Frequently Asked Questions
Is my data sent to a server? No. All formatting and validation runs entirely in your browser using JavaScript. Nothing is uploaded.
What does the minify option do? Minify converts your YAML to flow style, representing the entire document on as few lines as possible using inline syntax (, []).