Whitespace & Line Ending Cleaner
Trim lines, collapse extra spaces, remove blank lines, normalize line endings (LF/CRLF), and convert tabs to spaces. All in your browser.
How to use
- 1Paste your text
Any messy input — email replies, HTML source, log output, pasted PDF text.
- 2Pick the cleanups you want
Trim each line, collapse blank lines, or convert tabs to spaces are the most common combo.
- 3Read the cleaned output
Live update. Character count shows what you saved.
- 4Copy the result
One click, ready to paste into your document or code.
Examples
Line 1 Line 2 with leading spaces Line 3
Line 1 Line 2 with leading spaces Line 3
if (x) {
doStuff();
} if (x) {
doStuff();
}Line 1\r\nLine 2\r\nLine 3
Line 1\nLine 2\nLine 3
First Second Third
First Second Third
Frequently asked
LF for Unix, macOS, and modern editors. CRLF for legacy Windows tools. Modern codebases target LF and let Git handle line ending conversion.
Yes — if you turn it on it collapses ANY run of spaces to one, which will flatten indentation. Leave it off for code.
Removes leading and trailing spaces/tabs from every line. The most common cleanup for pasted text.
Trim lines and remove blank lines both preserve leading whitespace on lines that have non-whitespace content, so Markdown code blocks and Python code are safe. Only "collapse spaces" changes indentation — leave that off for code.
Not by default — regular ASCII spaces and tabs only. Non-breaking spaces (U+00A0) and other exotic whitespace stay put unless you explicitly search-and-replace them elsewhere.
Related tools
- Line SorterSort lines alphabetically, numerically, or by length. Remove duplicates, trim wh
- Text DiffCompare two blocks of text line by line and see exactly what changed. Runs entir
- Case ConverterConvert text between 12 cases: lower, UPPER, Title, Sentence, camelCase, PascalC
- Anagram CheckerCheck whether two words or phrases are anagrams. Options to ignore case, spaces,
- Lorem Ipsum GeneratorGenerate placeholder text in classic Lorem Ipsum or six themed flavors: hipster,
- NATO Phonetic AlphabetConvert any text into the NATO phonetic alphabet — Alfa, Bravo, Charlie, Delta,