How to use
Use it in seconds:
- Paste your YAML into the input box.
- Choose an indent size (2 or 4) and optionally enable Compact mode.
- Click Format YAML.
- Copy the formatted result.
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.