HTML Formatter
Beautify and indent HTML markup.
OpenTidy trailing spaces and extra blank lines in YAML while leaving indentation exactly as it is.
Add a full workflow, Compose or manifest file to the input.
Trailing spaces go and runs of blank lines shrink to one.
Indentation, keys and comments are left exactly as they were.
Copy the tidy file or save it as formatted.yaml.
A CI pipeline file has picked up trailing spaces and triple blank lines from several editors, and the lint step in your repo keeps complaining. You want a clean copy without any risk of changing the nesting.
This is a whitespace cleaner, and a deliberately conservative one. It removes trailing spaces and tabs from every line, reduces three or more consecutive line breaks to a single blank line, trims blank lines at the start and end of the file, and makes sure the output ends with exactly one newline. It does not re-indent nested maps, reorder keys, change quoting or touch comments, so the meaning of the document cannot change. The result updates as you type and downloads as formatted.yaml.
One edge case: if the very first line of your paste is indented, that indent is trimmed along with the surrounding blank lines, so paste complete documents rather than fragments copied from the middle of a file. For real problems such as tabs or a missing space after a colon, use the YAML linter. To confirm the file still parses, run it through the YAML Validator, or inspect the parsed data with YAML to JSON.
Cleanup happens with plain string operations in the page. No parser library is loaded and the file is not transmitted.
Keyboard shortcut
Answers for this tool. For site-wide help, open the FAQ hub.
No. Indentation is left exactly as you wrote it, because changing it could move a key under a different parent. Fix indentation errors in your editor, then use this tool for the final tidy.
No. Comment lines and inline comments are kept. Only trailing whitespace and surplus blank lines change.
Yes. Document separators (---) are ordinary lines to this tool, so multi-document files keep their structure. Blank lines between documents are reduced to one at most.