Skip to content

How to Remove Duplicate Lines in Excel, Word, Notepad and Online

This guide shows how to remove duplicate lines in Excel, Word, Notepad and online — and the one decision to make first: what exactly counts as a duplicate. If your list lives in a spreadsheet, this guide shows how to remove duplicates in Google Sheets as well as Excel — and to remove duplicates in Word, where no built-in command exists, it shows the manual Sort workaround instead.

Try it now: Remove Duplicate Lines  — paste your text, drop the repeats, copy the clean list. Free, no sign-up, runs in your browser.

First, decide what counts as a duplicate

Two lines can look identical to you and different to a computer. Before removing anything, decide how strict to be:

  • Capital letters. Are Apple and apple the same line? For names, emails and most human lists, yes. For product codes, passwords or anything case-sensitive, no.
  • Spaces at the edges. apple with a trailing space is technically a different line from apple. Invisible spaces copied from spreadsheets and web pages are the number one reason “I can still see duplicates!” after a cleanup.
  • Order. A good cleanup keeps the first occurrence of each line and leaves the surviving lines in their original order. Methods that sort your list alphabetically without asking (some do) can quietly ruin a list whose order meant something.

Keep those three decisions in mind — each method below handles them differently.

Method 1: Excel or Google Sheets

If your list lives in a spreadsheet, the built-in command is the right tool.

In Excel:

  1. Click any cell inside your list, then select the full range you want to clean.
  2. Go to Data → Remove Duplicates.
  3. Tick the column (or columns) that define a duplicate. One column ticked means “same value in this column = duplicate row.”
  4. Click OK. Excel deletes the repeated rows and tells you how many were removed.

In Google Sheets:

  1. Select your range.
  2. Go to Data → Data cleanup → Remove duplicates.
  3. Choose the columns to compare and click Remove duplicates.

Two warnings that apply to both: the command deletes rows immediately and permanently, so clean a copy of your sheet, not the only copy. And it compares whole cell values — a cell containing apple (trailing space) and one containing apple are treated as different, which is why spreadsheet deduping sometimes leaves look-alikes behind.

Method 2: Word or a text editor

Plain documents are less well served. Microsoft Word has no built-in remove-duplicate-lines command. The manual workaround is to select your list, use Home → Sort to group identical lines together alphabetically, then delete the repeats by eye — workable for twenty lines, miserable for two thousand.

If you edit text often, a programmer’s editor does it properly. In Notepad++ (free, Windows): open your list, then Edit → Line Operations → Remove Duplicate Lines. It keeps the first occurrence of each line and preserves your order. Most code editors offer the same through their command palette or an extension.

Method 3: Remove duplicate lines online, in one paste

When your list is plain text — or when the spreadsheet and editor routes feel like overkill — the simplest route is a tool built for exactly this job. You paste the list, set your two decisions (should case matter? should spaces around a line be ignored when comparing?), and copy back a clean list.

Try it here: our free tool to remove duplicate lines keeps the first occurrence of every line, preserves your original order, and runs entirely in your browser — your list is never uploaded or stored, which matters when the list is customer emails or anything else you would not paste into a random server.

A worked example

Say your merged list looks like this:

Weekly report
grocery list
Weekly report
Call plumber
grocery list␣
Birthday photos
Call plumber
travel receipts
Grocery List
Birthday photos
travel receipts

(The ␣ marks a trailing space you would never see on screen.) With case treated as unimportant and edge spaces ignored, those twelve lines collapse to five:

Weekly report
grocery list
Call plumber
Birthday photos
travel receipts

Notice what happened: the three versions of the grocery line — plain, trailing-space and capitalised — were recognised as one entry because the comparison was set to loose. With the strictest settings (case matters, spaces count), the same list keeps seven lines. Neither answer is “wrong” — they are answers to different questions, which is why deciding first matters.

Try it yourself: Remove Duplicate Lines

Which method should you use?

  • Your data is rows in a spreadsheet, and duplicates are defined by whole rows or key columns → Excel / Sheets (Method 1).
  • You already live in a code editor → Notepad++ or your editor’s line operations (Method 2).
  • Your list is plain text, hundreds or thousands of lines, mixed case, or copied from mixed sources → the online tool (Method 3), with the case and spacing settings chosen deliberately.
  • The list is private (emails, customer data, internal exports) → whichever method you choose, prefer one that processes locally on your own machine rather than uploading the file.

Remove Duplicate Lines FAQs

Does removing duplicates change the order of my list?

It shouldn’t. A careful cleanup keeps the first occurrence of each line and leaves everything else in its original order — that is how the Excel command, Notepad++ and our online tool all behave. Be wary of any method that sorts your list as a side effect unless sorting is what you wanted anyway.

Why can I still see duplicates after cleaning?

Almost always because of invisible differences: a trailing space, a tab, or a capital letter where the other copy has lowercase. Your eyes read them as identical; a strict comparison does not. Re-run the cleanup with case-insensitivity on and spaces around lines ignored, and the look-alikes will merge.

Is it safe to paste a private list into an online tool?

Only if the tool works locally. QuickTextTools’ tools run entirely in your browser — the text you paste is never sent to or stored on a server, so lists containing emails or internal data stay on your device. If a site asks you to upload a file to its server for a simple job like this, that is a reason to pick a different tool.

Will blank lines be treated as duplicates too?

Repeated empty lines compare equal to each other just like repeated words do, so most cleanups will collapse a run of blank lines down to one (or remove them along the way, depending on the tool). If your list’s blank lines are meaningful separators, split the list at those points and clean each section separately.