Remove duplicate rows from a CSV file

Compare entire rows, or only the columns that define a duplicate, such as email or order ID. Choose whether the first or the last occurrence stays. A second download holds every row that was removed, so nothing disappears without a trace.

Remove Duplicate Rows tool

Your file stays in this browser tab. It is not uploaded by SheetShift.

CSV file

Drag a file here, or

Options

How to use the Remove Duplicate Rows

  1. Load a CSV file or paste its text.
  2. To find duplicates by a key such as email, type that column name in the columns box. Leave it empty to compare every column.
  3. Pick whether to keep the first or last row of each duplicate group, and whether case and spaces matter.
  4. Press Remove duplicates. Download the cleaned file, and the removed rows if you want to review them.

Example: input and output

This example was produced by the same code the tool runs, with these settings: columns = email, ignoreCase = true, keep = first, trim = true. You can download the sample file(s): signups.csv.

Input
email,name,plan
ann@example.com,Ann Lee,pro
bob@example.com,Bob Ray,free
ANN@example.com,Ann Lee,pro
cy@example.com,Cy Wu,free
bob@example.com,Bob Ray,free
Output
email,name,plan
ann@example.com,Ann Lee,pro
bob@example.com,Bob Ray,free
cy@example.com,Cy Wu,free

Result summary: Removed 2 duplicate rows. Kept 3 rows.

Supported formats

CSV, TSV, TXT with or without a header row.

Limitations

  • Matching is exact after the options you choose. "Jon Smith" and "John Smith" are different values; this tool does not do fuzzy matching.
  • Row order is kept. Large files with a few hundred thousand rows work in a few seconds on a normal laptop.

When this helps

Deduplicate a newsletter list

The same person signed up twice with different capitalisation of their email. Matching on the email column with case ignored keeps one row each.

Clean a merged export

After combining exports from two systems, repeated order lines inflate totals. Remove them before a pivot table.

Frequently asked questions

How do I remove duplicates based on one column only?

Type the column name (or its number) into the columns box. Rows with the same value in that column count as duplicates, even if other columns differ.

Which row is kept?

By default the first occurrence stays. Switch to Last occurrence if the newest rows come at the bottom and you want those.

Can I see what was removed?

Yes. When duplicates are found, a second download button gives you a CSV of the removed rows.

Related tools

Guides: How to clean a messy CSV file, step by step · How to compare two spreadsheets and find what changed

Category: Data Cleaning