YAML Formatter & Validator
Paste your YAML to format, validate, or compact it instantly. Everything runs locally in your browser.
What is YAML?
YAML (YAML Ain't Markup Language) is a human-readable data serialization format built on indentation. It powers Kubernetes manifests, Docker Compose files, GitHub Actions workflows, Ansible playbooks, OpenAPI specs and most CI/CD configs. Because structure is encoded in whitespace, a single misplaced space or a stray tab breaks the whole document, which is exactly what this validator catches.
How to use this tool
- Format: re-indents your YAML cleanly with 2 or 4 spaces and normalizes block style. Tabs are never emitted: YAML forbids tabs for indentation.
- Minify: collapses the document to compact flow style (
{key: value, list: [a, b]}) on a single line, the smallest valid YAML representation. - Validate: parses against the YAML 1.1 and 1.2 specs and reports the exact line and column of the first syntax error.
When to use YAML vs JSON
Reach for YAML when a human edits the file by hand: configuration, infrastructure-as-code, pipelines. Its comments (#), multiline strings and lack of brackets make it pleasant to read and diff. Reach for JSON when a machine produces and consumes the data (APIs, logs, storage), where strict, bracket-delimited syntax leaves no room for indentation mistakes. Every JSON document is also valid YAML, which is why YAML's flow style looks JSON-like.
Limitations
- Single-document input only. Multi-document streams separated by
---aren't supported yet and report a clear error rather than failing silently. - Anchors (
&name) and aliases (*name) are resolved and expanded inline on format, so the output is self-contained. - Comments (
#) are stripped by Format and Minify: the parser keeps your data, not the layout. Validate leaves your input untouched.