YAML Formatter / Validator
Format, validate, and reindent YAML with precise error locations — powered by js-yaml, in your browser.
About this tool
The YAML Formatter & Validator parses your YAML and re-serializes it with consistent indentation, catching syntax errors before they break a Kubernetes manifest, Docker Compose file, or GitHub Actions workflow. Paste any YAML document and get back cleanly formatted output, or a precise error pointing to the exact line and column where parsing failed.
YAML's whitespace-sensitive syntax is notoriously easy to get subtly wrong — a misaligned list item, a tab where a space was expected, or an unclosed flow-style mapping can silently produce a different structure than intended, or fail outright. This tool uses js-yaml, the same YAML 1.2 parser used by countless Node.js tools, running entirely client-side. When your YAML is invalid, the error message includes the reason and the exact mark (line and column) where the parser stopped, mirroring what you'd see from a command-line linter.
You can choose 2-space or 4-space indentation for the reformatted output, and control the maximum line width (80, 120, or unlimited) to control how aggressively long scalars and flow collections get wrapped. Because everything runs in your browser with zero network requests, this tool is safe to use on YAML containing secrets, internal hostnames, or unpublished configuration — nothing is transmitted anywhere. Common uses: validating a Kubernetes manifest before applying it, cleaning up a hand-edited docker-compose.yml, normalizing indentation across a team's CI config files, or debugging a "bad indentation" error from a YAML-consuming tool.
