Formatters
YAML Formatter
Validate and prettify YAML config files.
Frequently Asked Questions & Guide
How to use this YAML Formatter
- Paste your YAML into the input box, or click Sample.
- Choose your preferred indentation (YAML spec requires spaces, never tabs).
- Click Format — Prettier will validate and beautify the YAML.
- Copy the result into your config file.
This formatter uses Prettier's YAML parser, which is YAML 1.2 compliant. It validates the document (any syntax error is shown in the status line) and re-emits it with consistent indentation, normalized quoting, and clean list formatting. It is perfect for cleaning up Kubernetes manifests, GitHub Actions workflows, Docker Compose files, Ansible playbooks, and application configs.
What is a YAML Formatter?
YAML ("YAML Ain't Markup Language") is a human-friendly data serialization format widely used for configuration files. Its whitespace-sensitive grammar makes it powerful but also error-prone — a single wrong indent level can completely change the meaning of a document. A YAML formatter (also called a beautifier) parses the document and re-emits it with consistent, predictable formatting, which both improves readability and surfaces indentation errors.
YAML is the configuration format of choice for Kubernetes, Docker Compose, GitHub Actions, GitLab CI, Ansible, AWS CloudFormation, and many other modern infrastructure tools. Formatting YAML consistently is especially important in infrastructure-as-code repos where small indent errors can cause hours of debugging.
Does it support YAML with embedded multi-line strings?
Yes. Prettier correctly handles YAML's literal block scalars (|), folded block scalars (>), and quoted multi-line strings. The output preserves the semantics of the input — a literal block stays a literal block, a folded block stays folded.
Why can't I use tabs for indentation?
The YAML spec explicitly forbids tabs for indentation. Mixing tabs and spaces, or using tabs at all, will cause a parse error. This is by design — YAML's whitespace-sensitivity makes tabs ambiguous. Prettier enforces the spec; we offer 2-space and 4-space options only.
Is my YAML sent to a server?
No. Everything happens in your browser. Your YAML never leaves your device.