Skip to tool
FeuTex · free tools runs in-browser no bloat built by LiMiT

YAML Formatter

Paste YAML and format it into a clean, consistent style (indentation, list dashes, and key: value spacing). The tool also flags common indentation issues and tabs.

Category: Developer · URL: /tools/yaml-formatter.html
Notes: tabs are not valid YAML indentation. Advanced YAML features (anchors/merge keys, multi-line scalars) are preserved as-is when possible, but this tool focuses on indentation and spacing cleanup.
Privacy: runs locally in your browser. No uploads, no tracking scripts.

How to use

Use it in seconds:

  1. Paste your YAML into the input box.
  2. Choose an indent size (2 or 4) and optionally enable Compact mode.
  3. Click Format YAML.
  4. Copy the formatted result.
Keywords this page targets (natural cluster): yaml formatter, format yaml online, yaml pretty print, yaml beautifier, yaml indentation fixer, prettify yaml, yaml format tool, yaml formatter with comments, fix yaml spacing, yaml list dash spacing, yaml key colon spacing, format kubernetes yaml, format docker compose yaml, yaml cleaner, yaml compact formatter, yaml lint formatting, normalize yaml indentation, yaml pretty printer, format yaml paste, yaml formatter in browser
Secondary intents covered: Make YAML indentation consistent (2 or 4 spaces), Fix common spacing issues like missing space after ':' or '-', Remove extra blank lines for a more compact YAML, Keep and normalize inline and full-line comments, Detect indentation mistakes that break YAML parsing, Quickly copy formatted YAML back into an editor, Clean up Kubernetes / Docker Compose manifests before committing

FAQ

What does this YAML formatter change?

It normalizes indentation (2 or 4 spaces), fixes common spacing (after : and -), trims trailing whitespace, and keeps comments.

Does it validate YAML fully?

It catches common indentation errors and tabs, but it’s not a full YAML parser/linter for every YAML feature.

Why are tabs rejected?

YAML indentation must use spaces; tabs frequently break parsers. Replace tabs with spaces before formatting.

Will my comments be kept?

Yes. Full-line and inline comments are preserved, and inline comments are normalized to a single space before #.

Does Compact mode change the data?

No. It only reduces extra blank lines and trims the output, making it shorter without changing keys/values.

Is my YAML sent to a server?

No. Formatting runs locally in your browser; the tool doesn’t make network requests.

Can I use this for Kubernetes or Docker Compose YAML?

Yes—this is great for cleaning up manifests and compose files, especially indentation and list formatting.