Long lists copied from spreadsheets, logs, or exports often contain the same entry many times. This tool removes exact duplicate lines while keeping your original ordering intact, and tells you exactly how many it stripped.
How it works
The input is split on newlines. For keep-first, a set tracks which line keys have already been seen, and any line whose key is already in the set is skipped:
for each line:
key = caseInsensitive ? line.toLowerCase() : line
if key not in seen: keep line, add key to seen
For keep-last, the tool records the index of the final occurrence of each key, then emits only the lines sitting at those indices. Either way the surviving lines stay in their natural position, so nothing is re-sorted.
Tips and examples
Use case-insensitive matching when cleaning email lists, where [email protected] and
[email protected] are the same address. Enable trimming for data copied from terminals
or PDFs, where invisible trailing spaces would otherwise hide duplicates. To
both sort and de-duplicate, run this tool first and then the Multi-line Text
Sorter, or vice versa — the removed-count readout lets you confirm the cleanup
did what you expected.