How to Remove Duplicate Lines in Excel, Notepad++ and Online
You know the problem: a list of emails or keywords with the same line pasted in three times, and you need it cleaned up fast. Paste your text into a free duplicate line remover tool and click one button — every repeated line disappears in under a second. No signup, no download, nothing installed.
Below, you will find four free ways to do it: the one-click online tool (the fastest), Excel’s built-in Remove Duplicates, Google Sheets’ UNIQUE formula, and Notepad++ for power users. You will also see what actually counts as a duplicate, how to handle tricky cases like trailing spaces and blank lines, and which method keeps your original line order intact.

What counts as a duplicate line?
Every tool on this page treats a duplicate the same way: a line is a duplicate if it is an exact character-for-character match of a line that appeared before it. That definition has three gotchas:
- Case matters. “Apple” and “apple” are different lines to most tools — capitalization counts as a difference.
- Invisible whitespace matters. “apple ” (with a trailing space) is not the same as “apple”. Trailing spaces are the #1 reason “obvious” duplicates refuse to disappear.
- Blank lines are lines too. If your text has five empty lines, four of them are technically duplicates and will be collapsed to one.
All four methods below work the same way: they keep the first occurrence of each line and delete the later repeats. None of them keeps a “random” copy.
How to remove duplicate lines with a free online tool (fastest)
The quickest way to remove duplicate lines from pasted text is a one-click browser tool. Our free Remove Duplicate Lines tool runs entirely in your browser — your text is never uploaded anywhere, which matters when you’re cleaning up customer lists, log files, or keyword data.
- Open the Remove Duplicate Lines tool.
- Paste your list into the box — thousands of lines are fine.
- Pick your options (case sensitivity, blank-line handling) and click one button.
- Copy the cleaned result with each line appearing exactly once.
Pros: takes under five seconds, works on any device with a browser, and keeps your original line order. Cons: not ideal if the list must stay inside a spreadsheet — use Method 2 instead. And if your pasted text is also full of unwanted line wraps, run it through the Remove Line Breaks tool first — as explained in yesterday’s guide on how to remove line breaks, PDF copy-paste is the worst offender.
Method 2 — Remove duplicate lines in Excel
Excel’s built-in feature is the best choice when the data already lives in a spreadsheet. Microsoft’s official guidance notes that Remove Duplicates permanently deletes data, so it recommends moving or copying the original data to another worksheet first — a step most people skip and later regret. Microsoft’s own Find and remove duplicates help article walks through the exact steps:
- Select the range of cells that contains the duplicate values.
- Go to Data > Remove Duplicates.
- In the dialog, check or uncheck the columns that define a “duplicate” — with a single column checked, Excel treats one identical line as a duplicate.
- Click OK. Excel tells you exactly how many duplicates it removed and how many unique values remain.
Prefer a formula that updates live? In Microsoft 365 or Excel 2021 and later, type =UNIQUE(A1:A100) in an empty column — it spills a live, de-duplicated copy of your list that refreshes when the source data changes. Older Excel versions don’t have UNIQUE, so the Data-tab method is the safe pick there.
Method 3 — Remove duplicate lines in Google Sheets
Google Sheets gives you two equally good options:
- One-time cleanup: select your column, then Data → Data cleanup → Remove duplicates. Sheets reports how many duplicates it removed and keeps the first occurrence of each value.
- Live formula: type
=UNIQUE(A1:A100)in an empty column. Like Excel’s version, it produces a spill range that stays in sync with your source data.
The formula route is better for shared sheets where new rows keep arriving — one person cleans, everyone sees the result, and nothing gets permanently deleted.
Method 4 — Remove duplicate lines in Notepad++
Notepad++ is the classic choice for text files and developer workflows. There’s one important detail: Remove Consecutive Duplicate Lines only deletes duplicates that sit next to each other, so you sort first:
- Open your file and press Ctrl + A to select all.
- Edit → Line Operations → Sort Lines Lexicographically Ascending. Identical lines now sit together.
- Go to Edit → Line Operations → Remove Consecutive Duplicate Lines. Each line now appears exactly once.
Watch out: sorting destroys your original line order. If order matters, number the lines first with Edit → Column Editor (Number to Insert), sort, de-duplicate, then sort by the number column and delete it.
The 4 methods compared
| Method | Time | Cost | Keeps original order | Handles partial duplicates | Best for |
|---|---|---|---|---|---|
| Online duplicate line remover | < 5 seconds | Free | Yes | No (exact lines only) | Quick pasted-text cleanup on any device |
| Excel Remove Duplicates | 1–2 minutes | Free (with Office) | Yes (first occurrence kept) | Yes, via column selection | Data already in a spreadsheet |
| Google Sheets (UNIQUE / Data cleanup) | 1–2 minutes | Free | Yes | Yes, via ranges | Shared or live-updating sheets |
| Notepad++ (sort + remove consecutive) | 1–2 minutes | Free | No (unless you pre-number) | No (exact lines only) | Text files and developer workflows |
Tricky cases: case, whitespace, and blank lines
When duplicates “refuse” to disappear, one of these is almost always the cause:
| Symptom | Real cause | Fix |
|---|---|---|
| Identical-looking lines survive | Trailing or leading spaces | Trim whitespace first (the online tool has a trim option; in Excel use =TRIM()) |
| “Apple” and “apple” both stay | Case-sensitive matching | Convert to lowercase first (Excel: =LOWER(); Notepad++: select all → Edit → Convert Case) |
| Empty lines remain | Blanks are duplicates of each other | Use a blank-line removal pass, or let the tool collapse them to a single blank line |
| Duplicates inside one cell aren’t removed | Tools work line-by-line, not inside cells | Split the cell into rows first (Excel: Data → Text to Columns; Google Sheets: Data → Split text to columns) |
Which method should you use?
- Cleaning a pasted list of keywords, URLs, or emails? Use the online tool — paste, click, copy, done in five seconds.
- Working in a spreadsheet you share with others? Google Sheets’
UNIQUEformula or Excel’s Remove Duplicates, so nothing is permanently lost. - Wrangling a log file or code list? Notepad++ gives you total control over sorting and formatting.
Frequently asked questions about removing duplicate lines
How do I remove duplicate lines from text quickly?
The fastest way is a free online tool: paste your text, click one button, and every repeated line is removed instantly while the original order is preserved. CoreAIWeb’s Remove Duplicate Lines tool does this entirely in your browser — no signup, no upload, no install.
How do I remove duplicate lines in Excel?
Select your data, go to Data → Remove Duplicates, choose the columns that define a duplicate, and click OK. Excel permanently deletes the repeats and reports how many duplicates it removed. For a live, auto-updating list, use the formula =UNIQUE(A1:A100) in Microsoft 365 or Excel 2021 and later.
How do I remove duplicate lines in Notepad++?
Select all, go to Edit → Line Operations → Sort Lines Lexicographically Ascending, then Edit → Line Operations → Remove Consecutive Duplicate Lines. Sorting first is essential because the removal step only deletes duplicates that are next to each other.
When I remove duplicate lines, which copy is kept?
The first occurrence is always kept and later repeats are deleted. This is consistent across the online tool, Excel’s Remove Duplicates, Google Sheets’ UNIQUE, and Notepad++ — so the surviving line is never random.
Is it safe to use a free online duplicate line remover?
Yes — as long as it runs in your browser. CoreAIWeb’s text tools process everything locally on your device; nothing is uploaded to a server, so even sensitive lists stay private. Avoid tools that ask you to create an account or upload a file for a simple cleanup.
Bottom line: to remove duplicate lines, the one-click online tool handles 95% of cases in seconds — and now you know the Excel, Google Sheets, and Notepad++ routes for the other 5%. Paste your list into the free Remove Duplicate Lines tool and get one clean, unique list.