Remove duplicate rows from a CSV by one column or the whole row

Choose the column that identifies a record, such as email, and the tool keeps one row per value, ignoring differences in upper case and stray spaces if you like, then lists exactly which rows it removed.

Live demo · real result from this tool

Drop your file here

or paste with Ctrl+V · nothing is uploaded

Or paste CSV / TSV in the box below. Excel files (.xlsx) use their first sheet.

Keep

Loading the tool…

Processed on your device — nothing is uploaded.

How to use the CSV duplicate remover

  1. Press Choose a file to load a CSV, TSV or Excel file, or paste rows into CSV data.
  2. Check Delimiter (Detect automatically works for most files) and First row is a header.
  3. In Match on columns (blank = the whole row), type the column names or numbers that identify a record. Leave it blank to remove only rows that repeat completely.
  4. Choose whether to Ignore upper/lower case and Ignore spaces around values, and whether to Keep the First occurrence or the Last occurrence.
  5. Copy the Deduplicated CSV or press Download to save <name>-deduplicated.csv.

What it does and when to use it

Duplicates creep in whenever lists are combined: two sign-up forms exported into one sheet, a contact list merged with last year’s, an order export run twice. Sending two emails to the same person or counting the same order twice causes real problems, so remove repeats before you import, mail or report.

Matching on a key column is usually better than matching the whole row. Two rows for “asha@example.com” may differ in the name (“Asha Verma” and “Asha V.”), yet they are the same customer. If you are joining several files first, use the CSV merger and then dedupe the merged result. Stray spaces in other columns can be fixed with the CSV cleaner. For a plain list with one value per line, the remove duplicate lines tool is simpler.

How it works

For each data row the tool builds a key from the chosen columns (or every column). With Ignore spaces around values, each value is trimmed; with Ignore upper/lower case, it is lower-cased. The first row with a key is kept, or, with Last occurrence, the last one. All other rows with that key go to the removed list. The header row is never compared and is always written first. The output uses the same delimiter as the input, and fields are quoted only when they need it.

Worked examples

The sample has five rows, matched on email, with case and spaces ignored:

email,name,plan
asha@example.com,Asha Verma,Pro
ben@example.com,Ben Carter,Free
ASHA@example.com ,Asha V.,Pro
mei@example.com,Mei Lin,Team
ben@example.com,Ben Carter,Free

Default settings. “ASHA@example.com “ (capitals and a trailing space) matches “asha@example.com”, and Ben appears twice. Result: unique rows kept 3, duplicates removed 2, values with duplicates 2.

Whole row, case-sensitive. Clear the match box and untick Ignore upper/lower case. Only Ben’s exact repeat goes: 1 duplicate removed, matched on whole row. Asha’s two rows differ, so both stay.

Keep the last occurrence. The output becomes ASHA@example.com ,Asha V.,Pro, then Mei, then Ben’s second row, each in its original position.

Limits and tips

  • Matching is exact after the optional trim and lower-casing. “Ben Carter” and “Benjamin Carter” are different.
  • A column name that does not exist gives a message listing the real column names.
  • To count how often each value appears before removing anything, try the frequency counter.

Frequently asked questions

How do I match on more than one column?
List them in "Match on columns", separated by commas, by name or number, for example "first_name, last_name" or "2, 3". Two rows count as duplicates only when all the listed columns match.
Does the tool change the rows it keeps?
No. Case and spaces are ignored only while comparing. The kept row is written exactly as it was in your file, with its original spelling and spacing.
Should I keep the first or the last occurrence?
Keep the first when the earliest record is the original, such as the first sign-up. Keep the last when later rows are updates, for example a newer address or plan. Either way, the kept rows stay in their original positions in the file.
Can I see which rows were removed?
Yes. A "Removed duplicates" table appears under the kept rows, with its own CSV download, so you can check or archive them.
What does "Values with duplicates" mean?
The number of distinct keys that appeared more than once. If one email appears three times and another twice, that is 2 values with duplicates and 3 rows removed.

Written by the ToolsRift team · Last updated

Pages are drafted with AI assistance and checked by automated tests. How we write and check pages.

Was this tool useful?

Report a problem

Start typing to search every tool.

↑ ↓ to moveEnter to openEsc to close