YAML formatter
Validate and reformat YAML, with clear line and column errors.
YAML formatter
YAML shows up everywhere from Kubernetes manifests to GitHub Actions workflows and application config, and it's unforgiving about whitespace: a single misaligned space breaks the whole document. This tool checks a YAML document's syntax and reprints it consistently, so you can catch a broken pipeline or config file before it ever runs.
Paste a document and it's parsed immediately. Valid input comes back reformatted with your chosen indent width; invalid input returns the exact line and column of the problem along with what the parser expected there, so you're not left guessing which of forty lines has the stray tab. Two checks run automatically on every valid document: a warning if any line uses a tab for indentation, since the YAML spec forbids tabs there even though many editors insert them by default, and a count of duplicate keys within the same mapping, which YAML allows but which usually means the last one silently wins and the others were dead weight.
The options control shape as well as whitespace. Sort keys alphabetically to get a deterministic, diffable document — handy when a generated config keeps producing noisy git diffs for no functional reason. Collapse short lists turns a scalar sequence like a three-line list of tags into a single flow-style line such as tags: [a, b, c]; leave it off and any inline flow lists in the input are expanded back into one item per line instead, which is usually easier to review and merge. Remove comments strips both full-line and trailing hash comments for a version meant to be minified or shared without notes, while keeping them off preserves your document's comments exactly as written.
Formatting runs entirely in your browser. The YAML you paste is never uploaded, logged or sent anywhere — it's parsed, reformatted and displayed locally, and it disappears the moment you close or reload the tab.