How to Remove Duplicate Rows From a CSV
The quick answer: you have three good options. The fastest is a browser-based CSV cleaner — drop the file in, tick Remove duplicate rows, download; nothing is uploaded. In Excel, use Data → Remove Duplicates. In Google Sheets, use Data → Data cleanup → Remove duplicates. All three keep the first copy of each row and drop the rest. The only real decision is what counts as a duplicate — covered below.
The three methods compared
All three keep the first occurrence of each row. Pick by what else you need:
| Method | Best when | Watch out for |
|---|---|---|
| Browser CSV cleaner | You want it fast, private, and to also trim spaces / drop blanks in one pass | Nothing — runs locally, keeps the header, never touches the file’s encoding or codes |
| Excel — Remove Duplicates | The file is already open in Excel and has no fragile codes | Opening a CSV in Excel can strip leading zeros and mangle long numbers before you even de-dupe |
| Google Sheets — Data cleanup | You work in Sheets and want a “removed N duplicates” report | Import with conversion off first, or codes get reformatted |
In your browser (keeps your codes safe)
This is the option that won’t damage anything else in the file. Because it treats every value as text, it can’t strip a leading zero or collapse a barcode the way opening the CSV in a spreadsheet can.
- Open the CSV cleaner and drop your file in (or paste the rows).
- Tick Remove duplicate rows. Optionally add Ignore case (so
Apple=apple) and Trim extra spaces (so"London "="London") to catch near-identical rows. - Click Clean & Download. The first copy of each row is kept, the header is preserved, and a summary shows exactly how many rows were removed.
De-duplicate without uploading a thing
The cleaner also drops blank rows and empty columns in the same pass, and offers an Excel-safe export so codes survive the next open. Everything runs in your browser.
Open the CSV cleaner →In Excel
Excel’s built-in tool is quick, but remember it permanently deletes rows, so keep a copy of the original first.
- Select your data (or click any cell inside it).
- Go to Data → Data Tools → Remove Duplicates.
- Tick the columns Excel should compare, confirm “My data has headers”, and click OK.
Excel keeps the first occurrence and removes the rest, then reports how many it deleted — the mechanics are documented in Microsoft’s guide to filtering for unique values or removing duplicates. One catch specific to CSVs: if you double-clicked the file to open it, Excel may already have damaged identifier columns. If your data has ZIP codes, SKUs or barcodes, import it as text first — see how to open a CSV in Excel without breaking it.
In Google Sheets
Sheets has a clean built-in tool that reports what it removed:
- Select the range (or click any cell in the data).
- Go to Data → Data cleanup → Remove duplicates.
- Choose the columns, tick “Data has header row”, and click Remove duplicates.
Sheets keeps the first instance of each row and tells you how many duplicates it removed, per Google’s remove duplicates and trim whitespace help. A non-destructive alternative is the =UNIQUE(A2:C) formula, which outputs a de-duplicated copy while leaving your original data untouched. If you’re importing the CSV into Sheets, do it via File → Import with conversion off so your codes survive — see Google Sheets dropping leading zeros.
What actually counts as a duplicate
A duplicate here means an exact whole-row match. That has two honest consequences worth knowing before you trust the result:
- A single different character means “not a duplicate.” Two rows for the same customer that differ by a middle initial, a trailing space, or
LtdvsLimitedare kept as separate rows. In the browser cleaner, ticking Trim spaces and Ignore case catches the cosmetic differences; genuine fuzzy matches (typos, abbreviations) need a human eye or a dedicated de-dupe tool, because guessing would risk deleting real records. - Comparing on fewer columns finds more duplicates — but only Excel and Google Sheets let you pick the columns. If you only care that an email address is unique, their Remove Duplicates dialogs let you compare on the email column alone. The browser cleaner always compares the entire row; to de-dupe on a single column with it, delete the other columns first, then clean.
Cleaning is about structure, not repair. If Excel also damaged the file — numbers in 1.23E+12 notation, missing leading zeros, é characters — fix that with the matching repair tool first, then de-duplicate. Browse all guides for the specific repairs.
Frequently asked questions
How do I remove duplicate rows from a CSV without Excel?
Use a browser-based CSV cleaner: drop the file in, tick Remove duplicate rows, and download. It runs on your device with nothing uploaded, keeps the header row, and can ignore case and trim spaces so rows that differ only by capitalisation or stray spaces are still caught.
How does Excel remove duplicate rows?
Select your data, then Data → Data Tools → Remove Duplicates, tick which columns to compare, and confirm whether your data has a header row. Excel keeps the first occurrence and permanently deletes the rest, so copy the original first. Opening a CSV in Excel can also damage codes, so import as text if the file has identifiers.
How do I remove duplicates in Google Sheets?
Select the range, then Data → Data cleanup → Remove duplicates, choose the columns and tick Data has header row. Sheets keeps the first instance of each unique row and reports how many it removed. The UNIQUE() function is a non-destructive alternative.
When you remove duplicates, is the first or last row kept?
All three methods keep the first occurrence and drop later identical copies. To keep the last one instead, reverse the row order first, remove duplicates, then reverse back.
Sources: Microsoft’s filter for unique values or remove duplicate values and Google’s split text, remove duplicates, or trim whitespace help.