Whitespace and Invisible Character Cleaner
Strip trailing spaces, convert CRLF to LF, remove BOMs and zero-width characters, collapse blank lines and convert between tabs and spaces.
Free · No sign-up · Your inputs stay in your browser
Input
Clean up whitespace and invisible characters
Output
Cleaned text
Found 6 CRLF, 2 invisible, 2 trailing runs, 1 tabs
A CRLF in a shell script gives '/bin/bash^M: bad interpreter'; a BOM before <?php sends output before headers. Both are invisible in most editors.
Runs in this browser. Nothing you paste is sent to a server.
About this tool
Method, assumptions, practical next steps, and limits.
The bugs whitespace causes
A shell script saved with Windows line endings fails with /bin/bash^M: bad interpreter, because the kernel reads the carriage return as part of the interpreter's name. A byte order mark before <?php is output, so PHP sends headers too late and sessions break. A non-breaking space in a YAML file is not indentation, and the parser says so in confusing terms.
Keeping it fixed
Cleaning a file once does not stop the next editor from undoing it. An .editorconfig with end_of_line = lf and trim_trailing_whitespace = true is read by most editors, and * text=auto eol=lf in .gitattributes normalises line endings when files are committed.