Remove Duplicate Lines
Remove duplicate lines from text while keeping the original order. Supports case-sensitive and case-insensitive modes.
Remove Duplicate Lines tool
Example
Input: 5 lines: apple, banana, apple, cherry, banana
Result: apple / banana / cherry (3 lines)
Each line is kept the first time it appears and later repeats are dropped, so the original order is preserved.
- Paste your text containing duplicate lines into the input area.
- Leave the Case Sensitive toggle on for exact matching, or turn it off so lines differing only in letter case count as duplicates.
- Optionally enable the Trim Whitespace option to ignore leading and trailing spaces during comparison.
- Review the deduplicated output, which keeps the first occurrence of each line in its original order.
- Check the stats bar under the input for the original line count.
- Click the copy button to copy the cleaned text to your clipboard.
Removing Duplicate Lines Without Losing Order
This tool deletes repeated lines from a list and keeps the first copy of each one in its original place. Paste 500 email addresses that include 60 repeats and you get 440 unique lines back, in the order you pasted them.
Two switches decide what counts as a repeat. Case Sensitive is on by default, so "Apple" and "apple" are kept as two lines. Turn it off to treat them as the same. Trim Whitespace is off by default. Turn it on to ignore spaces at the start and end of a line, which often sneak in when you copy from a spreadsheet or PDF. Either way, the line that stays is the original, exactly as you typed it. Blank lines are treated like any other line, so only the first empty line survives. The stats bar under the input shows how many lines you started with. Compare it with the output to see how many were removed.
Typical jobs include cleaning mailing lists, merging keyword lists, dropping repeated log entries and tidying exported data. To put the unique lines in order afterwards, use Sort Lines. To turn them into a comma-separated or SQL list, use the List Converter.
Frequently Asked Questions
Related Tools
Sort Lines
Sort lines of text alphabetically (A-Z or Z-A) with natural number order, by line length, or shuffle and reverse them.
Text and WritingWord Counter and Character Counter
Count words, characters, sentences, and paragraphs in your text. Includes reading time and speaking time estimates.
Text and WritingWhitespace Remover and Trimmer
Remove extra whitespace, trim leading and trailing spaces, collapse multiple spaces, and clean up messy text formatting.
Text and WritingFind and Replace
Find and replace text with regular expressions, capture groups, case-sensitive matching, and a live match count.
Text and Writing