Trim trailing whitespace, collapse repeated blank lines, and normalize line endings, instantly in your browser.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Clean whitespace and line endings online.
- Runs entirely in your browser — your text is never sent to a server
- Normalize line endings between LF and CRLF, and collapse blank lines
- Free, no account required
How it works
-
1
Paste the text into the Input box.
-
2
Choose which clean-up options to apply and the line ending.
-
3
Press Run.
-
4
Copy the cleaned text.
About the Whitespace Cleaner
Invisible whitespace causes visible problems: trailing spaces that show up in diffs, rows of empty lines in pasted text, and Windows line endings that break shell scripts on Linux. This cleaner removes trailing spaces and tabs from every line, collapses runs of blank lines into one, and rewrites all line endings as LF or CRLF.
What you can do
- Trim spaces and tabs from the end of each line.
- Collapse two or more blank lines in a row into a single blank line.
- Convert every line ending to Unix LF or Windows CRLF.
- Turn each option on or off, then copy the cleaned text.
When it works best
- Fixing a shell script that fails with bad interpreter errors because it was saved with CRLF endings.
- Cleaning up text copied from a PDF or web page before pasting it into code or a CMS.
- Removing trailing spaces that make a code review diff noisy.
Things to know
- Cleaning happens in your browser.
- Leading indentation and spaces inside lines are never changed, so it is safe for Python and YAML.
- Non-breaking and zero-width spaces are not removed; find them with the Unicode Character Inspector.
- To remove blank lines entirely or drop duplicates, use Sort & Dedupe Lines.
Frequently asked questions
No. Leading whitespace is never touched, only trailing spaces and blank-line runs.
Yes, every line ending can be rewritten as LF or CRLF.
No. Find them with the Unicode Character Inspector.
This tool collapses them to one. Sort & Dedupe Lines removes them entirely.