Duplicate Line Remover
Remove duplicate lines, with trim, sort and case options.
This tool needs JavaScript enabled to run in your browser.
What this tool does
This tool removes duplicate lines from text, keeping the first occurrence of each, and tells you how many it removed. Options let you trim each line, ignore case, drop empty lines and sort the result.
How it decides what is a duplicate
Two lines are duplicates when they match after your options are applied. Trimming removes leading and trailing whitespace before comparing, and ignore-case treats Apple and apple as the same. The first of each kept line stays in its original position unless you sort.
Common use cases
- Cleaning a list of emails, IDs or URLs.
- De-duplicating log lines or test data.
- Turning a messy paste into a unique, sorted list.
Frequently asked questions
- Which duplicate is kept?
- The first occurrence; later duplicates are removed. Turn on sort to order the result afterwards.
- Can it ignore case and whitespace?
- Yes. Options let you trim each line and compare case-insensitively.
Learning resources
Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.