YAML beautifier - format YAML in your browser
YAML is sensitive - whitespace is structure. A bad indent is an instant CI failure. The beautifier uses Prettier with the yaml parser.
In Gentle mode Prettier unifies indentation (2 spaces), normalises line endings, strips trailing whitespace. It does not change structure - because any change to indent in YAML changes meaning.
Accepts `.yml`, `.yaml`. Typical files: GitHub Actions (`.github/workflows/*.yml`), Docker Compose (`docker-compose.yml`), Kubernetes manifests (`deployment.yaml`), Helm charts, Ansible playbooks, CI configs.
How to use it
- Pick a mode (Gentle / Aggressive / Cosmetic-only) or keep the default.
- Paste your code into the left panel, or use "Upload file".
- Tune settings (gear icon): indent, width, quotes, semicolons.
- Click Format - first click takes a moment (libraries lazy-load).
- On the right you get the output with syntax highlighting - copy, download, or open in new tab.
When this is useful
Five YAML situations:
- GitHub Actions. `.github/workflows/ci.yml` with 6-space indent - beautify to 2.
- Kubernetes manifests. Helm-generated `deployment.yaml` with bad indentation.
- Docker Compose. Multi-service compose with mixed formatting.
- OpenAPI YAML. `swagger.yaml` after manual editing.
- Convert from JSON. You pasted from JSON into YAML and weird whitespace remained.