Free tool Text cleaner: remove line breaks, duplicate lines and blank lines
Text copied out of spreadsheets, PDFs, chats or exports comes with duplicate lines, blank lines, stray spaces and broken line breaks. Tick what you need and clean it in one pass: remove duplicates, remove blank lines, collapse spaces, unwrap lines, convert full-width characters, sort, and add a prefix or suffix to every line.
- Stack several steps
- Updates as you type
- Runs in your browser
Pick what to clean
Paste your text. Ticked steps run in a fixed order (see “Order of operations” below). Load an example with the buttons.
One item per line works best: keywords, URLs, names, IDs. Nothing is uploaded.
For example “ | ” or “; ”. \n is a line break, \t a tab.
Added before every non-empty line; {n} becomes the line number.
Added after every non-empty line; {n} works here too.
Lines before
10
Lines after
5
Duplicates removed
4
Blank lines removed
1
web analytics
web analytics tool
website traffic stats
mobile app analytics
live chat softwareVersion v1.0Updated Update history
What the numbers tell you
The cleaned text is in the code box, ready to copy or download as .txt. The counts help you confirm the cleanup did what you expected.
Lines before / after
How many lines you pasted and how many are left. Joining into one line gives 1; unwrapping gives one line per paragraph with a blank line between paragraphs.
Duplicates removed
Lines removed by “Remove duplicate lines” only. In the example, “web analytics”, “web analytics tool” and “live chat software” each appear twice, and the second “mobile app analytics” matches once its trailing spaces are trimmed: 4 lines removed.
Blank lines removed
Empty and whitespace-only lines removed by “Remove blank lines”.
Nothing changed
Shown when none of the ticked steps changed the text, for example when there were no duplicates to begin with.
De-duplication compares whole lines. To delete lines containing a word, or swap one term for another, use find and replace (regex supported).
Clean a list in three steps
Most cleanups combine a few steps: trim, drop blanks, de-duplicate, then sort or join into one line.
-
1
Paste the text
From a spreadsheet column, an export, a PDF or a chat.
-
2
Tick the steps
Order doesn’t matter: the tool always trims before it de-duplicates, so lines that look the same are treated the same.
-
3
Copy or download
The result is in the code box below; copy it back into your sheet or download a .txt file.
Ticked steps always run in this order
A fixed order means the same settings always give the same result.
- Blank lines are skipped when de-duplicating, so paragraph breaks survive unless you also tick “Remove blank lines”
- Sorting follows the page language with the browser’s built-in collation; natural sort compares numbers by value
- Prefix and suffix are only added to non-empty lines;
{n}counts those lines from 1 - “Unwrap lines” joins English lines with a space, joins CJK lines directly, and re-joins words hyphenated at the end of a line
| Step | Operation | Detail |
|---|---|---|
| 1 | Remove invisible characters | Zero-width characters, BOM and soft hyphens removed; non-breaking and other odd spaces become normal spaces |
| 2 | Full-width to half-width | Full-width letters, digits, punctuation and the ideographic space |
| 3 | Strip HTML tags | Tags and comments removed, text kept |
| 4 | Trim | Each line separately |
| 5 | Collapse spaces | Runs of spaces and tabs become one space |
| 6 | Remove blank lines | Empty or whitespace-only lines |
| 7 | Remove duplicates | First occurrence kept |
| 8 | Sort | A → Z / Z → A / natural / length / reverse |
| 9 | Prefix and suffix | Non-empty lines only |
| 10 | Line breaks | Keep / unwrap / join into one line |
A keyword list full of repeats
The default example: 10 keyword lines exported from a search tool, with “Remove duplicate lines”, “Remove blank lines” and “Trim” ticked.
| Step | What happens | Lines left |
|---|---|---|
| Original | 10 lines, one blank, two with stray spaces | 10 |
| Trim | “ website traffic stats” and “mobile app analytics ” lose their spaces | 10 |
| Remove blank lines | The empty line is removed | 9 |
| Remove duplicates | Second copies of “web analytics”, “web analytics tool”, “live chat software” and “mobile app analytics” removed | 5 |
Five lines remain, in first-seen order: web analytics, web analytics tool, website traffic stats, mobile app analytics, live chat software. Without “Trim”, the last line with trailing spaces would not count as a duplicate.
Duplicates still there? Usually one of these
Two lines that look identical but aren’t removed almost always differ invisibly.
Trailing spaces or tabs
Spreadsheet data often carries trailing spaces. Tick “Trim”, or tick “Ignore case and surrounding spaces”.
Invisible characters
Text from web pages, Word or chat apps can include zero-width or non-breaking spaces you can’t see. Tick “Remove invisible characters”.
Different case
“TapCub” and “tapcub” are different lines by default. Tick the ignore-case option if they should count as one.
Wanting to de-duplicate one column
Whole lines are compared. Copy just the column you want to de-duplicate, or strip the other parts first with find and replace.
What to do with a clean list
Clean keyword, URL and source lists usually end up next to analytics data.
Pages report
Check a de-duplicated URL list against each page’s visitors, views and time on page.
Learn moreSearch performance
Compare a clean keyword list with Search Console queries, clicks and positions.
Learn moreMarketing analytics
With consistent UTM source and campaign names, one channel no longer splits into several rows.
Learn moreText cleaner FAQ
Still have a question?
Chat with the team behind TapCub — we usually reply within a few hours on business days.
How do I remove line breaks from text?
Use “Line breaks”: “Unwrap lines, keep paragraphs” fixes text copied from PDFs and emails where every line is broken; “Remove all line breaks” joins everything; the “One line” options join with spaces, commas or your own separator, handy for turning a column into a list.
How do I remove duplicate lines online?
Paste the text and tick “Remove duplicate lines”. Each line is kept only the first time it appears, in the original order. Tick “Trim” and “Remove blank lines” as well so stray spaces and empty lines don’t get in the way.
Is de-duplication case-sensitive?
Yes by default: “TapCub” and “tapcub” are two lines. Tick “Ignore case and surrounding spaces” to treat them as one; the first spelling is kept.
How does sorting work?
A → Z uses the browser’s collation for the page language, so accented letters sort sensibly. Natural sort compares numbers by value, putting item2 before item10. Reverse just flips the order of lines.
How do I add numbers or quotes to every line?
Put {n}. in the prefix to number lines. Put a single quote in both prefix and suffix and choose “One line, separated by commas” to turn a column of IDs into a list for SQL IN (…) (see the IDs example).
Can it handle large lists?
Lists of tens of thousands of lines are processed quickly in the browser. Download the result as a .txt from the code box.
Is my text uploaded?
No. Everything runs in your browser; the text is not put in the URL or sent to TapCub.
Update history
New features, fixes and data refreshes for this tool, newest first.
-
· v1.0
LaunchedFirst release.
Missing something or found an error? Tell us — requests that come up often go into the next update. All tool updates
Check your clean list against real data
With TapCub installed, page, source and search query data can be exported and matched against your list line by line.