Skip to main content
WizTools123
Free Online Tools

Tool Categories


Text Tools New Tool

Free Online Remove Duplicate Lines, Keep First, Keep Last or Show Only Repeats

Take a list and leave one of each. Keep the first time a line appeared or the last, ignore case or spacing while comparing, and see how many copies each line had. You can also flip it around and keep only the lines that were repeated, which is how you find the duplicates rather than remove them.

Free Forever Nothing Uploaded Keep First or Last Find Repeats Too
Free Online Remove Duplicate Lines, Keep First, Keep Last or Show Only Repeats
Share this tool
Advertisement Slot (Top Banner) Google AdSense Unit • Responsive Banner
Remove Duplicate Lines Everything happens in this tab. Nothing you paste is sent anywhere.
Your list
0 characters 0 words 0 lines
The result
0 characters 0 lines
What to do
While comparing

0 lines in • 0 different • 0 removed

Buy Us A Coffee

Enjoying WizTools123? Help keep our server infrastructure 100% free and open for everyone.

Buy Us A Coffee
Sponsored Content (Below Tool) Google AdSense Placement

When Are Two Lines the Same Line

Every duplicate remover answers this. Most do not tell you how.

These two lines Same by default? Which switch changes it
apple and Apple No Ignore upper and lower case
apple and apple   Yes Ignore spaces at the ends, which is on by default
red apple and red  apple No Ignore double spaces inside
A blank line and another blank line Dropped Drop blank lines, which is on by default
There is a fifth case that catches almost everybody, and it is invisible. A list copied from Windows has a carriage return at the end of every line as well as a line break. Split on the line break alone and every line quietly ends with an invisible character, so apple and apple never match and nothing is removed. This page handles all three kinds of line ending, which is why a list pasted from Notepad behaves the same as one from a Mac.

Where Your Text Goes

Nowhere. And you can check that yourself.

A list of duplicates is usually a list of customers, and this page never receives it. The text is read and changed by your own browser. Press F12, open the Network tab, and use the tool: the page fetches its own code and nothing else. Or load the page, turn off your wifi, and carry on working. It still runs, because there was never a server in the middle.

How to Remove Duplicate Lines

Four steps, and your original text is never changed.

1
Paste your list One item per line: emails, product codes, URLs, names, anything. A .txt file can be opened or dropped on the box.
2
Decide what counts as the same Case and spacing are the two things that quietly split a duplicate into two different lines. Both have switches.
3
Choose what you want back The list with duplicates removed, only the lines that repeated, or every line with a count in front of it.
4
Copy or download The counts come out tab separated, so they paste straight into a spreadsheet as two columns.

What to Know Before You Deduplicate

Including the things this tool cannot do.

The order of your list is never shuffled. Removing duplicates keeps the lines where they were; only the extra copies go. Keeping the last copy instead of the first also keeps the order, which sounds obvious and is the thing most implementations get wrong, because it is easier to walk the list forwards and delete as you go.
Ignoring case or spacing changes what is compared, not what you get back. With ignore case on, Apple and apple count as the same line and the first one you wrote survives with its capital letter intact. Nothing in the result is lowercased or trimmed unless you asked a different tool to do it.
Blank lines are dropped by default, and that is a choice you can undo. Most lists that arrive with blank lines have them by accident, from a copy that included spacing. If the blank lines are structure rather than noise, switch that off and they are kept and compared like any other line.
This compares whole lines, not parts of them. Two rows of a CSV that differ only in a comment column are two different lines here, even though the useful data is the same. To dedupe on one column, cut the list down to that column first, or sort by it and check by eye.

Key Features & Capabilities

What this tool does, and what it deliberately does not.

First or last copy Keep whichever one you need, and the order of the list stays as it was.
Find them instead Flip it around to keep only the lines that appeared more than once.
Counts per line Every line with how many times it appeared, tab separated for a spreadsheet.
Case and spacing switches Decide what counts as the same line, instead of guessing what the tool assumed.
Windows line endings Lists pasted from Notepad behave the same as lists from anywhere else.
Nothing uploaded Your list stays in your tab, which matters when it is a list of customers.

About the Remove Duplicate Lines

Lists collect duplicates. Two exports get merged, a form was submitted twice, a spreadsheet column was pasted on top of another one. Finding the repeats by eye works up to about twenty lines and then stops working entirely, and sorting first only helps if you also remember to look.

This removes them, and it also does the opposite job, which is asked for just as often: show me only the lines that repeated. A third mode puts a count in front of every line, tab separated, so pasting it into a spreadsheet gives you two proper columns and you can sort by frequency.

The part worth reading is which lines count as the same. Case and stray spaces are what usually turn one duplicate into two entries that survive, and an invisible carriage return from a Windows text file will defeat a tool that only splits on the newline. All three are handled here, and the switches are on the page rather than hidden in the code.

Frequently Asked Questions

Why duplicates survive, and how to find them instead of removing them.

No, and that is deliberate. The lines stay in the order you pasted them, with the extra copies removed. If you want it sorted as well, use the result with the Sort Lines tool, or press Use as input there.

Which one survives when a line appears more than once. For a log where the newest entry matters, keep the last. For a list where the first appearance is the original record, keep the first. Either way the surviving line stays in the position it was in.

Switch the first dropdown to keep only the repeated lines. You get one copy of each line that appeared more than once, which is the list of things worth investigating.

Almost always case or spacing. Apple and apple are different lines unless you switch on ignore case, and red apple with two spaces is different from red apple with one unless you switch on ignore double spaces. Try turning both on and see if the count changes.

Not directly. This compares whole lines. To do it by one column, cut the list down to that column first, dedupe, and use the result as a lookup list.

Every Other Text Tool

24 more tools in this set. All free, all in your browser.

Advertisement Slot (Bottom Banner) Google AdSense Unit • Responsive Banner