Remove Duplicate Lines
Keep only the first copy of every line.
How to use
Remove Duplicate Lines Online
This tool takes a list with one item on each line and removes repeated lines, keeping the first time each item appears. It suits word lists, name lists, email lists and any notes where the same line was pasted more than once.
How to use it
- Paste your list into the top box, with one item per line.
- Choose the options: Ignore case, Trim spaces, Drop empty lines and Sort A-Z.
- Read the result box, which updates immediately as you type or tick options.
- Check the summary, such as "2 removed, 3 kept", then press Copy result.
Rules / how it works
- Two lines count as duplicates only when they are identical after the chosen options are applied. A line is never judged by meaning, only by its characters.
- The first copy is kept and later copies are dropped, so the original order is preserved unless you tick Sort A-Z.
- Trim spaces and Drop empty lines are ticked by default. Trim spaces removes spaces at the start and end of each line, so "apple" and "apple " match.
- Without Ignore case, "Apple" and "apple" are different lines. With it ticked, they are treated as the same and the first spelling is kept.
- Sort A-Z orders the kept lines alphabetically using the browser's locale comparison.
- The "removed" number counts all input lines that did not make it into the output, which includes empty lines when Drop empty lines is on.
- For example, the list apple, Apple, banana, apple with Ignore case ticked becomes apple and banana.
Study tips
- Paste the vocabulary you collected from several reading passages and remove repeats before you make flashcards.
- Merge your classmates' lists of important questions, remove duplicates and sort them to see the topics clearly.
- If a result looks wrong, check for invisible differences such as extra spaces or capital letters.
- Keep your original list somewhere, since the tool only gives you the cleaned copy.
Want to launch an e-commerce store, portfolio, or business website without coding from scratch? Explore finished, mobile-ready websites with free full setup and 100% code ownership at Nowvelle.
Frequently asked questions
Which copy of a duplicate line is kept?
The first one. The tool reads from top to bottom, remembers each line it has seen and skips later matches. If Ignore case is on, the first spelling and capitalisation is the one that appears in the result.
Why are lines like "apple" and "apple " treated as the same?
Trim spaces is ticked by default, which removes spaces at the beginning and end of each line before comparing. Untick it if you want lines that differ only by trailing spaces to stay separate.
Does sorting change my list permanently?
No. Sort A-Z only changes the result box. Your pasted text stays in the input box, so you can untick the option to return to the original order of the kept lines.