Text Tools
Remove Duplicate Lines
Remove duplicate lines from a list while keeping the original order. Keep the first or last copy, list only repeats or unique lines, or count each line.
How to use Remove Duplicate Lines
Paste one item per line and the deduplicated list appears as you type. Choose what to output, decide how blank lines are handled, and tick Ignore case if "Apple" and "apple" should count as the same.
- Paste your listPaste one item per line, such as email addresses, keywords or product codes.
- Choose the outputKeep the first or last copy, show only duplicated lines, only lines that appear once, or a count table.
- Set matching rulesLeading and trailing spaces are ignored by default; tick Ignore case to treat capitals and lower case as equal.
How duplicates are matched, with an example
Lines are compared after optional trimming and case folding, and the output keeps the original order. Take apple, banana, apple, Apple, " banana", a blank line, cherry, another blank line and banana: nine lines. With the defaults (spaces trimmed, case kept, blank lines removed) you get apple, banana, Apple, cherry, and the note reports 9 lines in, 4 out, with 3 repeats. Tick Ignore case and Apple merges with apple, leaving apple, banana, cherry. Keep last instead keeps each item where it last appears, which is useful when later entries in a log are the most recent.
Five ways to use the result
Remove duplicates, keep first is the classic dedupe for mailing lists and keyword sets. Keep last suits logs and exports where the newest entry wins. Only lines that were duplicated lists each repeated value once, handy for spotting double bookings or repeated order numbers. Only lines that appear once drops every value that has a twin. Count each line returns a table sorted by frequency, for example banana 3, apple 2. Blank lines can be removed, kept in place, or deduplicated like any other line.
Accuracy and data handling
Before copying the output, check names, punctuation and the intended meaning against the source text. The calculation runs in your current browser; the tool code does not send the input to a processing API.
FAQ
Does removing duplicates change the order of my list?
No. Lines stay in their original order; only the later copies (or, with Keep last, the earlier ones) are dropped. Use the Sort Lines tool if you also want the list sorted.
Is the duplicate check case-sensitive?
By default, yes: "Apple" and "apple" are different lines. Tick Ignore case to treat them as the same; the spelling that is kept is the one from the copy that stays.
How do I see how many duplicates were removed?
The note under the result shows lines in, lines out and how many lines were repeats. For per-line totals, choose Count each line to get a table of every distinct line and how often it occurs.
Are lines with extra spaces treated as duplicates?
Yes, while Ignore leading/trailing spaces when comparing is ticked (the default), so " banana" matches "banana". Spaces inside a line still count.
More Text Tools
Related toolsCompare two texts and highlight added, removed and changed lines.
Clean double spaces, stray tabs, blank lines and invisible characters.
Sort a list A to Z, naturally, by number or by length.
Delete blank lines or squeeze runs of them down to one.
Bulk-convert phone numbers to E.164, international or national format.
Rank the most frequent words and phrases with counts and shares.