Remove Duplicate Lines
Remove duplicate lines from your text and keep only unique entries.
Built and tested by Muhammad Irfan Liaqat · Updated
Remove Duplicate Lines: key facts
- Removes repeated lines and keeps the first occurrence of each, in the original order
- Options: case sensitive matching and trimming spaces at the start and end of lines (both on by default)
- Blank lines are kept, and the result shows how many duplicates were removed
- Compares whole lines; it does not sort the list or remove duplicate words within a line
How duplicate lines are detected
Paste a list and this tool removes every line that repeats an earlier one, keeping the first occurrence in its original position. The cleaned list updates as you type and shows how many duplicates were removed, ready to copy into a spreadsheet, email tool or code.
Two options decide what counts as a duplicate. Case sensitive, on by default, treats “Apple” and “apple” as different lines; turn it off to merge them. Trim whitespace, also on by default, ignores spaces at the start and end of each line, so “apple ” and “apple” match. Blank lines are left where they are, and the order of the list is never changed, so sort it in a spreadsheet first if you need alphabetical output.
How to remove duplicate lines from a list
- 1Paste your list into the box, one item per line
- 2Choose whether matching is case sensitive and whether to trim spaces
- 3Check the result and the number of duplicates removed
- 4Click Copy to copy the cleaned list