YAML Formatter Online
line-based reindent trailing whitespace cleanup. Uses the bundled YAML parser to preserve parsed values. Formatting does not preserve comments or original scalar style. Script/settings generation remains available where provided.
Scope of this tool: Uses the bundled YAML parser to preserve parsed values. Formatting does not preserve comments or original scalar style. Script/settings generation remains available where provided.
Parser-backed YAML formatting preserves parsed values, not comments or original scalar style. Legacy tab-rewriting/compact options do not rewrite YAML values.
What it does: trims trailing spaces, converts tabs to spaces, normalizes line endings, and (when safe) reindents using the detected indentation unit.
How to use
Use it to clean YAML without changing content (best-effort). For complex YAML features, review the result before using it in production.
- Paste your YAML into YAML input.
- Choose an indentation size (2 or 4 spaces).
- Click Format.
- Copy the result or click Use output as input to iterate.
FAQ
Is this a full YAML validator/linter?
No—this is a whitespace/indentation formatter with basic indentation consistency warnings; it does not fully parse YAML.
How does the formatter decide indentation levels?
It detects the most likely indentation unit from your file (e.g., 2 or 4 spaces) and reindents to your chosen size when indentation is consistent.
What if my YAML has inconsistent indentation?
The tool warns you and keeps the original indentation to avoid producing YAML that changes meaning or becomes invalid.
Does it support block scalars, anchors, and complex YAML features?
It preserves your text lines and only adjusts whitespace; for complex YAML, always review the formatted result before using it.
Why convert tabs to spaces?
Many YAML parsers reject tabs for indentation; converting tabs to spaces prevents common parse failures.
Is my YAML uploaded to a server?
No. Formatting runs locally in your browser and the tool does not make network requests.
Can I keep my current indentation but still clean whitespace?
Yes—if indentation is inconsistent, the formatter keeps it while still trimming trailing spaces and normalizing line endings.
Continue your workflow
Browse related tools by task. Use the improved core tools for a consistent workspace with file import, downloads and clear validation errors.