Loading the interface. JavaScript is required; controls stay disabled until ready.
Paste your text, then choose the cleanup options above.
Select Clean text to generate your result here.
Maximum 1,000,000 input units. Operations run in the documented fixed order. Selecting line operations reconstructs mixed line endings using the first ending, unless LF normalization is selected.
How Text Cleaner works
Cleanup is opt-in: choose only the changes you want. Line operations use the first line-ending format unless LF normalization is selected. Review the output before copying.
How to use this tool
- Paste or type text into the labelled input.
- Select the whitespace cleanup operations you need, then choose Clean text.
- Review the output, then copy it. Clear empties the input and output.
Processing happens locally. Text is not uploaded or saved by this tool. Keep a separate copy before leaving the page.
A practical example
Use two spaces between words and select Collapse spaces and tabs to replace them with one space.
Questions and answers
Will cleanup change my punctuation?
No. Whitespace operations leave punctuation alone; duplicate removal and sorting act on whole lines.
What is the difference between trimming and removing whitespace?
Trimming removes spaces and tabs only at the start and end of each line, leaving the spaces between words. Removing or collapsing whitespace changes spacing inside the line, for example turning several spaces into one. Pick trimming for lists and code, and collapsing for prose copied from PDFs or web pages.
What are CRLF and LF line endings?
Windows traditionally ends lines with two characters, CR and LF, while macOS and Linux use LF alone. Mixing them can cause odd spacing in code editors, Git diffs or CSV imports. Normalising to LF gives consistent files for web projects and most servers.
Will cleaning remove hidden characters such as non-breaking spaces?
Non-breaking spaces and zero-width characters often arrive from Word, web pages and chat apps and can break searches or spreadsheet formulas. They look like normal spaces, or like nothing at all. If a search or comparison still fails after cleaning, retype the affected word or space by hand and test again.
Choose only the cleanup you need
Whitespace cleanup changes the structure of text without intentionally rewriting the words. It is useful after copying from email or a formatted document, but each operation should match a specific problem. Tabs, blank lines and indentation can also carry information worth preserving.
A practical example
A sentence with several spaces between words can be made more compact by selecting the space-and-tab collapse option. A blank row between every list entry needs a different operation. Start with one selected change, inspect the output and add another only if it helps. Cleanup is not a grammar or spelling correction service.
Protect meaningful formatting
Indentation can define a code block, a table or a nested list. Removing blank lines can merge paragraphs that were intentionally separated. Do not run every option on a source file merely to make it shorter. Keep an original copy and compare representative sections before replacing it in your editor or publishing system.
Line endings and visual wrapping
A wrapped sentence is not necessarily a stored newline. Line-based operations use actual separators and generally preserve the first detected line-ending format unless LF normalization is selected. Browser pasting may already normalize separators. If your task requires an exact byte-level file comparison, this pasted-text cleaner is not that audit.
Worked example: tidying pasted text
Text pasted from a web page or email arrives with double spaces after full stops, tabs between words, three or four blank lines between paragraphs and stray spaces at line ends. Turn on Collapse spaces and tabs, Collapse consecutive blank lines and Trim each line, and leave everything else off. Paragraphs stay separated by a single blank line, so the result pastes cleanly into Word, Google Docs or a CMS. Line breaks inside a paragraph are kept, so join those by hand if the source was a PDF.
Choose your next task
- Text compare tool: Review the original against cleaned text before replacing it.
- Remove duplicate lines: Remove repeated entries with explicit matching rules.
- Line counter: Check how cleanup changes blank and non-empty row counts.