Updated · Built and checked by the PlinzoTools team, formulas tested against published sources
Remove repeated lines from a text block, keeping the first occurrence.
apple
banana
cherry
BananaThis tool removes repeated lines from a text block -- a list, a data dump, log output -- keeping only the first occurrence of each unique line and preserving the original order. An optional case-insensitive mode treats "Apple" and "apple" as duplicates.
Paste text with one item per line, and choose case-sensitive or case-insensitive comparison. Deduplicated output appears instantly.
Each line is tracked in a set as it's encountered; a line matching one already seen is dropped, while the first occurrence of every unique line is kept in its original position -- unlike sorting, the remaining lines' relative order is fully preserved.
For sorting lines (with an optional dedup step built in) instead, see the Text Line Sorter.
Take a hypothetical list of five lines: apple, banana, apple, cherry, Banana. In case-sensitive mode the result is apple, banana, cherry, Banana, because only the second "apple" is an exact repeat. Switch the comparison to case-insensitive and the result becomes apple, banana, cherry, since "Banana" now matches the earlier "banana" and is dropped. In both modes the surviving lines keep their original spelling and their original order. In case-insensitive mode, the tool keeps the first version it saw, whichever capitalization that was.
Lines are compared as whole strings. The tool does not trim spaces, so "apple" and "apple " (with a trailing space) count as different lines and both survive. The same goes for a line that has a leading tab or invisible characters copied from a web page. If a list still shows what look like duplicates after processing, the cause is nearly always hidden whitespace. Clean the text with the Whitespace Trimmer first, then remove duplicates. Also note that comparison does not ignore punctuation, so "apple" and "apple," are distinct.
Case-insensitive mode lowercases each line for comparison. For plain English text this behaves as expected. Emails are a good example of where you should think first: the domain part is not case-sensitive, but the local part technically can be on some mail systems, so removing entries that differ only by case is normally safe for mailing-list cleanup but worth a glance if precision matters.
An empty line is treated like any other value. The first blank line stays, and later ones are removed, so a list with many gaps will end up with at most one blank line. That may leave a stray empty row at an unexpected spot in your list, so glance at the output before pasting it into a spreadsheet or a script.
No -- blank lines are treated as their own "value" and deduplicated like any other line (multiple blank lines collapse to one); use the Remove Empty Lines Tool if you want them stripped entirely.
No -- each kept line stays in its original relative position; only the later duplicate occurrences are removed, not the lines around them.
Case-sensitive treats "Apple" and "apple" as different lines (both kept); case-insensitive treats them as duplicates (only the first kept), useful when the same value appears with inconsistent capitalization.
Always the first occurrence. Later matching lines are removed, and the line order is otherwise unchanged.
They probably differ by hidden whitespace, such as a trailing space or a tab. Trim the text first, then remove duplicates.
The one from the first occurrence of that line in your text.
Reference: MDN Web Docs