TapCub is live — analytics, insights and live chat, free on one platform

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
Text cleaner

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.

Lines before

10

Lines after

5

Duplicates removed

4

Blank lines removed

1

Cleaned text
web analytics
web analytics tool
website traffic stats
mobile app analytics
live chat software
Runs entirely in your browser. Nothing you type here is uploaded or stored by TapCub.

Version v1.0Updated Update history

Reading the result

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).

How to use it

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. 1

    Paste the text

    From a spreadsheet column, an export, a PDF or a chat.

  2. 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. 3

    Copy or download

    The result is in the code box below; copy it back into your sheet or download a .txt file.

Order of operations

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
Order of operations
StepOperationDetail
1Remove invisible charactersZero-width characters, BOM and soft hyphens removed; non-breaking and other odd spaces become normal spaces
2Full-width to half-widthFull-width letters, digits, punctuation and the ideographic space
3Strip HTML tagsTags and comments removed, text kept
4TrimEach line separately
5Collapse spacesRuns of spaces and tabs become one space
6Remove blank linesEmpty or whitespace-only lines
7Remove duplicatesFirst occurrence kept
8SortA → Z / Z → A / natural / length / reverse
9Prefix and suffixNon-empty lines only
10Line breaksKeep / unwrap / join into one line
Worked example

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.

How the default example is processed
StepWhat happensLines left
Original10 lines, one blank, two with stray spaces10
Trim“ website traffic stats” and “mobile app analytics ” lose their spaces10
Remove blank linesThe empty line is removed9
Remove duplicatesSecond copies of “web analytics”, “web analytics tool”, “live chat software” and “mobile app analytics” removed5

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.

Common mistakes

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.

FAQ

Text 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.

Changelog

Update history

New features, fixes and data refreshes for this tool, newest first.

  1. · 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

Next step

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.

See your data clearly. Find your growth.

Every click, backed by data. Install one line of code and see your first numbers in a minute.

No credit card · Free plans for analytics and chat · Cookieless analytics