This tool removes repeated lines from a list and keeps the original order of the lines that remain. It is useful for cleaning email lists, keyword exports, log excerpts and any pasted column of text.
Your data is processed locally in your browser and is not uploaded to our server.
0 lines in0 lines out0 removed
How to use this tool
1 Paste the list into the input box, one item per line.
2 Choose whether to ignore case, trim surrounding whitespace and drop empty lines.
3 Select whether the first or the last occurrence of a duplicate should be kept.
4 Copy the cleaned list, or clear the boxes to start with another list.
Formula and calculation logic
Comparing lines
Key = line, optionally trimmed and lowercased
Each line is converted to a comparison key. With “ignore case” enabled, “Apple” and “apple” share a key and count as duplicates; without it they remain separate.
Keeping the first or last copy
Keep first = first occurrence; keep last = last occurrence, in original order
The output preserves the original line order. Keeping the last copy changes which value survives, not the position of the remaining lines.
Worked example
Cleaning a keyword list
A pasted list contains repeated keywords and blank lines.
Input: apple, Banana, apple, banana, (blank)
Ignore case and empty lines: apple, Banana
Removed: 3 lines
Two unique keywords remain. Because case is ignored, “apple” and “Banana” win as the first occurrences.
Keeping the latest value
A list of prices where the last entry is the current one.
Input: 10, 12, 10, 15
Keep last occurrence of each value
Output: 12, 10, 15
The repeated 10 is kept at its later position, and the earlier duplicate is dropped.
Edge cases and accuracy
Whitespace matters
With trimming off, a trailing space makes two otherwise identical lines different. Turn trimming on when the list comes from a spreadsheet or a PDF copy.
Empty lines
Empty lines can be kept or removed independently of duplicate checking. Removing them is usually what you want before counting entries.
Order is preserved
Deduplication never sorts the list. If you also need alphabetical order, use the sort lines tool afterwards.
Frequently asked questions
Does it remove duplicates across the whole list or only adjacent lines?+−
It checks the whole list, not just neighbouring lines. A duplicate anywhere in the input is detected.
Is the comparison case-sensitive?+−
By default it is not: “Apple” and “apple” are treated as the same line. Untick “Ignore case” to keep them as separate entries.
Which copy is kept by default?+−
The first occurrence is kept by default. Switch to “Keep last” if the later line has the value you want to preserve.
Does it change the order of the remaining lines?+−
No. The output keeps the original order of the lines that survive, whether you keep the first or the last copy.
Is my list uploaded?+−
No. All processing happens in your browser, so the list never leaves your device.
Related text tools
Count, sort or compare the list once it is deduplicated.