Clean Up Text
Strip extra spaces, blank lines and duplicate lines from text, choosing only the cleanups you want. Nothing you enter is sent to a server.
Input
Result
Your result will appear here
Run the cleanup to compare the result with your original side by side.
User reviews
No reviews yet. If you’ve used this tool, be the first to leave one.
Clean Up Text: complete guide
Walk through the steps and examples, or jump straight to the topic you need.
At a glance
- Cleanup functions
- Whitespace cleanup, blank line removal, duplicate line removal, and cleaning up selected items all at once.
- Input
- Up to 100,000 characters. A UTF-8 text file must be 512KB or less.
- Whitespace rule
- Removes whitespace at the start and end of each line and reduces runs of spaces and tabs inside a line to one space.
- Duplicate rule
- Compares whole lines for exact matches and keeps the first line that appeared and the order.
- Order of processing
- Clean up all at once runs only the selected items, in the order whitespace, blank lines, duplicate lines.
How to use Clean Up Text
Enter the list or text to clean up
Paste text into the original, or load a file when the input is empty. For material where whitespace itself carries meaning, such as tables or code, first decide which cleanup is needed.
Select what to change
To do only one job, choose that mode. To do several together, turn on only the items you need in Clean up all at once. It does not remove every space between words.
After running, compare lines and whitespace
The original stays and the result is shown in a separate area. If you apply whitespace cleanup first, two lines that differed only in whitespace become the same and can become targets for duplicate removal. For an important list, check that the missing lines are what you intended.
Copy or save the finished result
Use copy and TXT save to carry it into your next task. If you change the input or options, the previous result is cleared and you need to run it again. If you emptied the original, you can use undo on screen.
What it’s good for
Tidying whitespace and removing blank lines
Whitespace cleanup removes spaces at the start and end of each line and reduces runs of spaces inside a line to a single space. It does not delete every space between words. Remove blank lines removes lines that have no content or only whitespace.
The order in which duplicate lines are removed
In "Clean up all at once", only the items you selected are processed in the order whitespace, then blank lines, then duplicate lines. Duplicates are judged on lines that are exactly the same after the earlier cleanup, and the first occurrence and the order are kept. Lines that differ in upper or lower case are treated as different lines.
Worked examples
Applying several cleanups in order
apple
apple
pearapple
pearLines that differ in case are kept
Apple
apple
AppleApple
appleWhich cleanup should you turn on?
Swipe the table sideways to see the rest.
| Choice | What changes | What stays |
|---|---|---|
| Whitespace cleanup | Whitespace at the start and end of lines, and runs of spaces and tabs | A single space between words and line breaks are kept. |
| Remove blank lines | Lines that are empty or only whitespace | The text of lines with content is kept. |
| Remove duplicate lines | Exactly identical lines that already appeared earlier | The first line and the overall order are kept. |
When the result isn’t what you expected
The column spacing of my table is gone
Whitespace cleanup may have merged tabs or multiple spaces into one space. The original is still there, so turn whitespace cleanup off and run it again. If you need to keep table structure, use a tool suited to editing columns.
Lines that look the same are left as duplicates
Check whether the spaces at the start or end of the lines, or the upper and lower case, differ. To merge lines that differ only in whitespace, select both whitespace cleanup and duplicate line removal. Case and sentence content are never unified on its own.
Repeated words in a sentence stay as they are
The unit of duplicate removal is a whole line, not words or parts of a sentence. Words repeated inside a line are not deleted automatically. Compare to check whether the removal changes the meaning of the original.
Key terms
- Blank line
- A line with no characters at all, or only whitespace characters.
- Duplicate line
- An item whose whole line has the same string at the time of comparison.
- Tab
- A whitespace character used for table columns or code indentation.
Clean Up Text FAQ
Does it also remove repeated words or parts of sentences?
Duplicates are removed only when a whole line is the same. Words or parts of sentences repeated inside a single line are not deleted automatically.
Can I paste content copied from Excel?
You can paste it as text, but with whitespace cleanup on, tabs between cells also become a single space. If you need to keep the column structure of a table, turn whitespace cleanup off and check the result.
Is the original overwritten right away?
The result is shown in a separate area so you can compare it with the original. If you change the input or the options, the previous result becomes invalid, so run it again.
Does it sort the result alphabetically?
It keeps the order in which lines appeared in the original and does not sort alphabetically or numerically. If there are duplicates, the first line is kept.
What happens if I turn off all the selected cleanup items?
In Clean up all at once, there must be an item to process before it can run. Select at least one item and then check the result.