Comparison 6 min read

Remove Duplicates in Excel, Google Sheets or Online: Which to Use

Compare Excel Remove Duplicates, UNIQUE, Google Sheets data cleanup and an online duplicate line remover: case, spaces, order and when each one fits best.

remove duplicates excelremove duplicates google sheetsunique function excelremove duplicate lines onlinededupe list case sensitive

The short answer

Use Excel's Remove Duplicates or Google Sheets' Data cleanup when your data is in rows and columns and you want to delete repeated rows in place. Use the UNIQUE function when you want a live, separate list that updates as the data changes. Use an online tool such as Remove Duplicate Lines when you have a plain list (emails, keywords, names, URLs) and want control over case and spaces without opening a spreadsheet. The biggest practical difference between the methods is how each one treats capital letters and extra spaces.

The four methods at a glance

MethodWorks onChanges original dataCase handlingBest for
Excel Data > Remove DuplicatesRows in a range or tableYes, deletes rowsNot stated by Microsoft; test on a copyCleaning a table once
Excel UNIQUE functionA rangeNo, outputs a new listNot stated by MicrosoftA list that updates automatically
Google Sheets Data cleanupRows in a rangeYes, deletes rowsIgnores case (documented)Shared sheets in Google Drive
Lazyblink Remove Duplicate LinesOne item per line of textNo, gives a new listYou choose with a checkboxQuick lists, any device

Method 1: Excel Remove Duplicates

Microsoft's steps are:

  • Select the range, or click a cell inside a table.
  • Go to Data > Remove Duplicates (in the Data Tools group).
  • Tick the columns that should be compared. Use Select All to require the whole row to match.
  • Click OK. Excel reports how many duplicates were removed and how many unique values remain.
  • Things to know before you click OK:

    • It deletes data. Microsoft's help page warns that you are permanently deleting data and suggests copying the range to another sheet first. Ctrl+Z works straight away, but not after you save and close.
    • It compares what is displayed. According to Microsoft, matching depends on what appears in the cell, not the stored value. A date shown as 3/8/2006 in one cell and Mar 8, 2006 in another is treated as two different values.
    • Column choice matters. If you tick only the Email column, Excel removes the whole row whenever an email repeats, even if the Name column differs.

    Method 2: Excel UNIQUE function

    If you have Excel for Microsoft 365, Excel 2021, Excel 2024 or Excel for the web, you can type a formula instead of deleting anything:

    • =UNIQUE(A2:A500) returns each distinct value from A2:A500 once.
    • =UNIQUE(A2:A500,,TRUE) returns only the values that appear exactly once. This is a different question: it drops every value that was repeated, including its first copy.

    Because UNIQUE spills its results into the cells below, keep that space empty. The result updates when you edit the source range, which makes it good for dashboards and dropdown lists. Older versions such as Excel 2016 and 2019 do not have UNIQUE; use Remove Duplicates there.

    Method 3: Google Sheets Data cleanup

    Google's steps are:

  • Select the data range.
  • Go to Data > Data cleanup > Remove duplicates.
  • Choose the columns to analyse and tick Data has header row if the first row contains headings.
  • Click Remove duplicates.
  • Google's help page states that cells with identical values but different letter case, formatting or formulas are treated as duplicates. So "Ravi@Example.com" and "ravi@example.com" count as the same entry and only one is kept.

    Google Sheets also has Data > Data cleanup > Trim whitespace, which removes leading, trailing and repeated spaces. Run it before removing duplicates, because "Mumbai" and "Mumbai " (with a trailing space) are different text. Google notes that non-breaking spaces are not trimmed, which often catches people who paste from web pages.

    Method 4: An online duplicate line remover

    The Remove Duplicate Lines tool works on plain text, one item per line. Paste a list, choose the options and click Remove Duplicates. It has three settings:

    • Case sensitive (on by default). When on, "Apple" and "apple" are kept as two different lines. Turn it off to treat them as the same; the first version that appears is the one kept.
    • Trim whitespace (on by default). Spaces and tabs at the start and end of each line are removed before comparing, so "Mumbai " and "Mumbai" match. Spaces inside a line are not changed.
    • Sort result (off by default). When off, the list keeps its original order with the first occurrence of each item. When on, the cleaned list is sorted alphabetically.

    Empty lines are dropped, and they are included in the "duplicates removed" count shown above the result. You can copy the cleaned list or download it as a .txt file. The processing happens in your browser.

    A worked example

    Input (7 lines):

  • ravi@example.com
  • Priya@Example.com
  • ravi@example.com
  • priya@example.com
  • (blank line)
  • amit@example.com
  • ravi@example.com (with a trailing space)
  • With the default settings (case sensitive on, trim on), the result is 4 lines: ravi@example.com, Priya@Example.com, priya@example.com and amit@example.com. The tool reports 3 removed: two repeats of ravi@example.com (one of them only differed by the trailing space) and the blank line.

    With Case sensitive turned off, priya@example.com is also treated as a repeat of Priya@Example.com, leaving 3 lines.

    For email addresses, turning case sensitivity off is usually what you want, because the domain part is not case sensitive in practice and most people type their address in different ways. For codes, passwords or product SKUs where case matters, leave it on.

    Which one should you use?

    • Your data is a table with several columns and you want whole rows removed: Excel Remove Duplicates or Google Sheets Data cleanup.
    • You need the clean list to stay up to date as new rows are added: UNIQUE.
    • You only want items that appear once (for example, find customers who ordered only one time): UNIQUE with the exactly_once argument set to TRUE.
    • You have a list copied from an email, a PDF, a CRM export or a website, or you are on a phone: the online tool is faster than building a sheet.
    • Case must be respected (for example, case-sensitive codes): the online tool with Case sensitive on, because Google Sheets ignores case and Microsoft does not document Excel's behaviour.

    Common mistakes

    • Not trimming first. Invisible trailing spaces are the most common reason duplicates "survive". Use Trim whitespace in Sheets, TRIM() in Excel, or keep Trim on in the online tool.
    • Selecting the wrong columns. In spreadsheets, comparing one column removes entire rows. Check the column ticks before confirming.
    • Losing the original. Work on a copy, or use a method that outputs a new list.
    • Mixing formats. Phone numbers written as +91 98765 43210 and 9876543210 are different text. Standardise them first, for example with Find and Replace.

    Related guides

    Frequently asked questions

    Is Google Sheets remove duplicates case sensitive?

    No. Google's help page says cells with identical values but different letter case, formatting or formulas are treated as duplicates, so only one is kept.

    What is the difference between Remove Duplicates and UNIQUE in Excel?

    Remove Duplicates deletes repeated rows from your data. UNIQUE is a formula that returns a separate list of distinct values and updates when the source changes. UNIQUE needs Excel for Microsoft 365, 2021, 2024 or the web.

    How do I remove duplicates but keep the original order?

    In the Lazyblink Remove Duplicate Lines tool, leave Sort result off. It keeps the first occurrence of each line in its original position.

    Why are some duplicates not removed?

    Usually because of hidden differences such as trailing spaces, different capitalisation or different number formats. Trim spaces first and turn off case sensitivity if capital letters should not matter.

    Try this tool on Lazyblink

    Put this guide into practice with our free online tool — no signup required.

    Open tool