How to remove duplicate lines from a list
- Paste your list into List to deduplicate with one item per line. Windows line endings are converted to plain newlines before any lines are compared.
- Choose how strict the matching should be. With no options ticked,
Appleandapplecount as two different lines. Tick Ignore letter case (Apple = apple) if capitalisation doesn't matter. - Tick Ignore surrounding spaces ("Apple " = "Apple") if some lines may have leading or trailing spaces you can't see.
- Click Remove duplicates. The counters show Total Lines, Unique Lines and Duplicates Removed. Below them, the What repeated table lists each value that appeared more than once, how many times it appeared and on which line numbers.
- Click Copy result to copy the cleaned list.
- Or click Download result to save it as a
.txtfile.
To deduplicate a file without opening it, click Load from file or drag a .txt or .csv file onto the input field. The duplicates are removed as soon as the file loads.
The Copy removed lines button copies only the extra copies that were taken out. If you tick or untick an option after a run, the result updates straight away.
Examples: what stays, what goes and what repeated
A plain list with exact repeats (the Simple list example):
Input: Output:
apple apple
banana banana
apple orange
orange
banana
The counters show Total Lines 5, Unique Lines 3 and Duplicates Removed 2. What repeated lists apple twice, on lines 1 and 3, and banana twice, on lines 2 and 5.
The Mixed case & spacing example contains Apple, apple, APPLE (with a trailing space) and Banana. The result depends on which options are ticked:
| Options ticked | Result | Removed |
|---|---|---|
| None | all 4 lines unchanged | 0 |
| Ignore letter case | Apple, APPLE , Banana |
1 |
| Ignore letter case + surrounding spaces | Apple, Banana |
2 |
With only letter case ignored, APPLE survives because of its trailing space.
In a list of error messages without timestamps, repeated messages collapse to one line each:
Error: timeout
Error: disk full
Error: timeout
Error: timeout
This becomes Error: timeout and Error: disk full. What repeated shows Error: timeout 3 times, on lines 1, 3 and 4.
Where a deduplicated list is useful
- Mailing and invite lists: you merged sign-ups from two forms and want each address only once. Tick both options.
[email protected](capital A, trailing space) and[email protected]reach the same inbox, but they only count as duplicates when both case and surrounding spaces are ignored. The line that stays is the first one exactly as typed, trailing space included, so run Whitespace Normalizer afterwards if the space matters. - A standalone column of tags, IDs or SKUs: paste the column, remove the repeats, and paste the result into an empty column or a new sheet. Don't paste it back next to other columns. The cleaned column is shorter, so every row below the first removed duplicate would no longer line up with its neighbours.
- Error and message lists: this works when each line contains only the message, for example a pasted list of errors or the message column from an export. Raw log lines usually start with a timestamp or process ID, which makes every line unique, so nothing is removed.
- Checking data quality without deleting anything: copy the removed lines, or download the groups as CSV, to report which entries were duplicated and on which lines.
If you also want the cleaned list in alphabetical order, paste the result into Sort lines.
Blank lines, hidden characters and other edge cases
- Blank lines are compared like any other value. The first empty line is kept and later empty lines are removed. If you want no blank lines at all, run the result through the Remove empty lines tool.
- Hidden characters: the spaces option also strips a non-breaking space or a byte order mark at the start or end of a line. It does not strip a zero-width space. A line that starts with one looks identical to
applebut stays as a separate line. To clean those characters out first, use Invisible character remover. - Whole lines only: a line is removed only if it matches an earlier line in full. To work on items inside a comma-separated row, put each item on its own line first.
- Size: you can paste or type up to 1,000,000 characters. With Load from file you can open a text file of up to 2 MB. Very large inputs depend on your device's memory.
- The What repeated table shows the first 20 repeated values on the page. The CSV download always contains every group.