Skip to content

Remove Duplicate Rows from CSV or Excel

Find and remove repeated rows in a CSV or Excel file. Compare every column, or only the ones that matter, like an email or an order ID.

Runs in your browser. Your file is never uploaded.

What it does

Rows that repeat are removed and the first copy is kept. With the two "ignore" options on, rows that differ only in capital letters or extra spaces count as duplicates too.

contacts.csv · 4 rows
emailnamecity
asha@mail.comAsha RaoPune
tom@mail.comTom BeckerBerlin
ASHA@mail.com Asha RaoPune
tom@mail.comTom BeckerBerlin
Cleaned · 2 rows
emailnamecity
asha@mail.comAsha RaoPune
tom@mail.comTom BeckerBerlin

Watch how it works

Watch the tool in action (2 min) · open on YouTube

How to remove duplicates

  1. Drop your CSV or Excel file above.
  2. Untick any columns that shouldn't be compared. To keep one row per customer, leave only the customer or email column ticked.
  3. Check the count of removed rows, then download the cleaned file. You can also download the removed rows to check them.

Doing it in Excel

Select your data, then go to Data → Remove Duplicates, tick the columns to compare and click OK. Excel deletes the extra rows straight away and keeps the first copy. Make a copy of the sheet first, because there's no list of what was removed.

In Excel 365 you can also leave the original untouched and write =UNIQUE(A1:G500) in an empty cell. Google Sheets has the same UNIQUE function and a Data → Data cleanup → Remove duplicates menu.

Doing it in SQL or Python

In SQL, SELECT DISTINCT * keeps one copy of each fully identical row. To dedupe by a single column and keep the latest row:

SELECT * FROM (
  SELECT *, ROW_NUMBER() OVER (PARTITION BY email ORDER BY created_at DESC) AS n
  FROM customers
) WHERE n = 1;

In pandas: df.drop_duplicates(subset=["email"], keep="last").

Why near-duplicates slip through

Rows that look the same often aren't: a trailing space, Pune vs pune, or a date stored as text in one row and as a date in another. Turn on the two "ignore" options to catch the first two. For dates, make the column a consistent format in the source file first.

Questions

Does it work with Excel files as well as CSV?

Yes. Drop a .csv, .xlsx or .xls file. For workbooks, the first sheet is used, and you can pick another one after the file loads.

How large a file can I clean?

Files over 20 MB are handled by DuckDB, a database engine that runs in this page and reads the file from your disk in pieces, so files of 1 GB and more work on a normal laptop. The first time, your browser downloads the engine (about 30 MB) and then caches it. Results are saved straight to disk, so even very large cleaned files download fine. Excel files are limited to what a workbook can hold: about one million rows.

What counts as a duplicate?

Two rows are duplicates when every column you tick has the same value. Tick only “email”, for example, to keep one row per email address even if other columns differ.

Which copy is kept?

By default the first one, which matches Excel’s Remove Duplicates button. Choose “Keep the last” if newer rows sit at the bottom of your file and you want those.

Will “Asha Rao” and “asha rao ” count as the same?

Only if you turn on “Ignore upper/lower case” and “Ignore extra spaces”. Both are off by default so nothing is removed unless it truly matches.

Is my data uploaded?

No. The file is read and processed by your browser. Nothing is sent to a server.