SafeWebUtilities

Remove duplicates from a CSV file

Choose a CSV, pick the columns that define a duplicate, and download a clean copy. It runs in your browser, so your data is never uploaded.

How it works

The tool reads your file in the browser and compares the columns you tick, ignoring case and extra spaces if you like. It keeps the first or last row in each group of matches and gives you the cleaned rows plus a list of what it removed. For Excel files, save the sheet as CSV first. See a worked example.

How a duplicate is decided

Two rows are duplicates when every column you tick under “Columns that must match” has the same value. Columns you leave unticked are ignored, so they can differ. With the first two boxes ticked, as they are at the start, capital letters and extra spaces do not count: “Ann Lee” and “ANN LEE ” (with a space at the end) match, but “Ann Lee” and “Anne Lee” do not. Extra spaces means spaces at the start or end of a value and more than one space in a row.

Take this small file. The Row column only numbers the lines for this explanation and is not in the file.

RowNameEmailCity
1Ann Leeann@example.comLeeds
2ANN LEEAnn@Example.comLeeds
3Bob Roybob@example.comYork
4Ann Leeann@example.comHull
5Bob Roybob@example.comYork

Your row order and the header row stay as they are. The tool also gives you the removed rows as a separate file, so you can check what it took out before you use the cleaned one.

Questions

Can I use it for Excel (.xlsx) files?

Not yet. Save the sheet as CSV first: in Excel choose File, Save As and pick CSV UTF-8.

Is my data uploaded anywhere?

No. The file is processed in your browser and never leaves your device.

How does it decide two rows are duplicates?

Rows are duplicates when every column you tick has the same value. By default the tool ignores upper and lower case and extra spaces, so Ann@Example.com and ann@example.com match.

Which row is kept?

The first row in each group of matches, or the last if you choose that. Your row order is kept.

Why do accented letters look wrong?

The tool expects UTF-8. If your file uses another encoding, re-save it as CSV UTF-8 first.

How big a file can I use?

It depends on your device. Files with hundreds of thousands of rows can be slow, and phones struggle sooner than computers.

How do I remove duplicates based on one column, such as email?

Untick every column except Email under “Columns that must match”. The tool then keeps one row for each email address, the first or the last as you choose, and removes the other rows with that address even if their other columns differ. Download the removed rows to check what was taken out.

Why does it say no duplicates when I can see some?

By default every column must match, so two rows that differ in even one column, such as an ID, a date or a note, are not duplicates. Untick the columns that differ. Other common causes are different spelling or punctuation, a leading zero (007 and 7), accented and plain letters (é and e), and invisible characters such as a zero-width space copied from a web page. Capital letters, extra spaces and non-breaking spaces do not matter while the first two boxes are ticked.

What happens to empty cells?

A row is kept as it is when every column you ticked is empty in that row, for example when you tick only Email and some people have no email address. Those rows are not treated as duplicates of each other. Untick “Keep rows where all chosen columns are empty” if you want them treated as duplicates, so that only the first (or last) one stays. Lines in the file that are completely empty are dropped when the file is read.

Does it work with semicolon or tab separated files?

Yes. It opens .csv, .tsv and .txt files, looks at the first line, uses whichever of comma, semicolon or tab appears most often there, and saves the cleaned file with the same separator. If your file uses another separator, such as a pipe, convert it first.