How to Remove Duplicate Lines
Use this free duplicate line remover to clean up a list without checking each entry manually. It compares complete lines and keeps one occurrence of each distinct line, using your selected settings.
- Paste your text into Original Text, with one entry per line.
- Choose whether to ignore capitalization, trim surrounding spaces, and remove empty lines.
- Keep the original order or choose alphabetical sorting. Select whether to keep the first or last occurrence.
- Click Copy to copy the result from Unique Lines.
Results update automatically as you type or change an option. Your original input stays available, so you can try different settings without pasting your list again.
Duplicate Line Removal Example
Original Text
Apple Banana Apple Orange Banana Grape
Unique Lines
Apple Banana Orange Grape
This example contains six original lines and four unique lines. Two duplicate occurrences are removed: the second Apple and the second Banana.
Remove Duplicate Lines Without Changing Order
Leave Sort by set to Original Order and choose Keep First Occurrence to retain each line where it first appears. Later matches are removed without rearranging the remaining entries.
With Keep Last Occurrence, the tool retains the final matching entry instead. Original Order then follows the positions of those retained entries. For example, a list containing Apple, Banana, and Apple on separate lines becomes Banana followed by Apple.
To preserve surrounding spaces too, turn off Trim leading and trailing spaces.
Remove Duplicate Lines Ignoring Capitalization
Matching is case-sensitive by default:
Apple, apple, and
APPLE are different lines.
Enable Ignore capitalization
to treat these as matches.
The retained line keeps its capitalization.
Keeping the first occurrence of those three entries
produces Apple; keeping the last
produces APPLE. This option does not
convert the entire result to lowercase or uppercase.
Remove Duplicate Lines from a List
Paste keywords, product names, URLs, email addresses, or other entries with one item per line. The tool compares the entire line, including punctuation and spaces within the entry.
For example, red shoes and
red boots remain separate entries.
A line containing very very useful
keeps both occurrences of “very.” To sort individual
words or remove repeated words from a word list,
use our
Word Sorter.
URLs and email addresses are compared as text. The tool does not validate addresses, follow redirects, remove tracking parameters, or combine similar URLs. Leave Ignore capitalization off when letter case matters to your data.
Remove Duplicate Lines from Excel or Google Sheets Data
Copy a single column of entries from Excel or Google Sheets and paste it into Original Text. Each line is treated as one entry. Review the cleaned list, copy it, and paste it into an empty column in your spreadsheet.
This tool processes pasted text, not spreadsheet files or entire workbooks. Use it for independent lists: removing entries from one column does not remove the corresponding rows from other columns. Cells containing embedded line breaks need extra care because each pasted line is processed separately.
Remove Empty Lines and Extra Spaces
Trim leading and trailing spaces
removes surrounding whitespace, including spaces
and tabs, before matching and producing the result.
With trimming enabled, Apple and
Apple become the same entry.
Spaces within a line are preserved.
Remove empty lines discards blank and whitespace-only lines. Trimming is enabled by default; empty-line removal is optional and starts unchecked. Adjust these options to suit your list.
When empty-line removal is off, blank lines take part in duplicate matching. Trimming makes whitespace-only lines equivalent to empty lines; without trimming, lines containing different spaces or tabs can remain distinct.
Understanding the Line Counts
- Original Lines counts the lines in your input before cleanup, including empty lines.
- Unique Lines counts the retained output entries after applying your settings.
- Duplicates Removed counts extra matching occurrences, excluding lines discarded by Remove empty lines.
Empty input shows zero for every count. A line break at the end of your input creates a final empty line, which is included in Original Lines. With Remove empty lines enabled, that empty line is discarded. A short note below the statistics reports empty lines removed separately.
Related Text Tools
Frequently Asked Questions
Does this remove all copies of a repeated line?
No. It keeps one occurrence of each distinct line and removes the additional matches. Choose whether to retain the first or last occurrence.
Can I remove duplicates without sorting my list?
Yes. Original Order is selected by default. The retained entries stay in the order in which they appear in your original text.
Are uppercase and lowercase lines treated as duplicates?
Only when Ignore capitalization is enabled. By default, lines such as Apple and apple remain separate entries.
Do spaces affect duplicate matching?
Yes. Trimming removes whitespace at the start and end of each line before comparison. Turn trimming off to make those spaces significant. Spaces inside a line always remain significant.
Can I sort the unique lines alphabetically?
Yes. Choose Alphabetical (A–Z) or Alphabetical (Z–A) from Sort by. Sorting changes the order of the retained lines, not which occurrence is kept.
Does it remove repeated words within a sentence?
No. It compares whole lines. Words within a retained line stay unchanged, even when the same word appears more than once.
Why does Original Lines minus Unique Lines differ from Duplicates Removed?
When Remove empty lines is enabled, blank and whitespace-only lines are discarded separately. Those removals are not counted as duplicates.
Does the tool support Windows and Mac line endings?
Yes. CRLF, LF, and CR line endings are recognized. Results use standard newline separators between retained entries.
Can I process a large list?
Yes. Large lists can take longer to process depending on their size and your browser or device. Wait for the updated result before copying it.
Is my text uploaded for duplicate removal?
No. The duplicate-removal tool processes your text locally in your browser and does not send it to a server for processing. No account or payment is required.
Finished cleaning your list? Use our Character Counter to check its character count or set a custom character limit.