Remove repeated lines from a pasted list while keeping the first occurrence in its original position.
Example
Apple, Banana, Apple, Orange and apple become Apple, Banana, Orange and apple when matching is case-sensitive. Turn case-sensitivity off and the same list becomes Apple, Banana and Orange.
Calculation method
The tool reads from top to bottom, keeps the first time each line appears and removes every later copy, so the original order is preserved. Sorting is not applied, and blank lines count as lines, so repeated empty lines collapse to a single one.
Important notes
Lines must match exactly, including spaces, so “Apple” and “Apple ” with a trailing space are treated as different. If stray spaces come from a spreadsheet, run the Whitespace Remover first, and use Sort Lines afterwards if you also want alphabetical order.
First occurrence stays in place
Paste one item per line. The tool reads from top to bottom, keeps the first time each line appears and removes later copies, so the original order is preserved. Apple, Banana, Apple, Orange and apple become Apple, Banana, Orange and apple when matching is case-sensitive. This is useful for cleaning email lists, keywords, tags or product codes copied from several sources before importing them elsewhere.
Case-sensitive or not
With case-sensitive matching, “Apple” and “apple” are different lines and both remain. Turn the option off to treat them as the same; the first spelling is kept, so the same list becomes Apple, Banana and Orange. Choose based on the data: email addresses are usually case-insensitive in practice, while passwords, file paths on some systems and product codes may not be. Review the result when capitalisation carries meaning.
Hidden spaces and blank lines
Lines must match exactly, including spaces. “Apple” and “Apple ” with a trailing space are treated as different, which is why Apple, Apple␠ and Apple leave two lines; run the Whitespace Remover first if stray spaces come from a spreadsheet. Blank lines are lines too, so several empty lines collapse to a single one: two empty lines, Apple and two more empty lines become one empty line followed by Apple. Sorting is not applied; use Sort Lines afterwards if you also want alphabetical order.
Worked examples| Input | Result |
|---|
Apple↵Banana↵Apple↵Orange↵apple · case-sensitive | Apple↵Banana↵Orange↵apple |
Apple↵Banana↵Apple↵Orange↵apple · ignore case | Apple↵Banana↵Orange |
Apple↵Apple␠↵Apple · case-sensitive | Apple↵Apple␠ |
↵↵Apple↵↵ · case-sensitive | ↵Apple |
Frequently asked questions
Should I use case-sensitive matching?
It depends on the data. Email addresses are usually case-insensitive in practice, while passwords, file paths on some systems and product codes may not be. With the option on, “Apple” and “apple” both remain; with it off, the first spelling is kept. Review the result when capitalisation carries meaning.
Is the original order preserved?
Yes. The first occurrence stays exactly where it was and only later copies disappear, which is what makes this safe for lists where the order matters, such as a queue of tasks or a ranked set of keywords.
Why are two apparently identical lines both kept?
Because something invisible differs, most often a trailing space or a non-breaking space pasted from a web page or spreadsheet. Clean the whitespace first and run the list again. This is also why a list of email addresses copied from several sources can still show duplicates after a first pass.