<link rel="stylesheet" type="text/css" href="/mirawhite.css">

Remove duplicate rows from a CSV file

Drop or paste a CSV to delete its repeated rows, for free. Choose which columns define a duplicate, for example the email address alone, and see exactly which rows were removed.

Free, no sign-up, no limit Runs in your browser: your text and files are never sent or saved.

Remove duplicate CSV rows

Drop a .csv file here, or paste its content below.

The file is processed in your browser: it is never uploaded.

Options
Recommended for files you did not create: it prevents Excel from running hidden formulas.

How to use it

  1. Drop your .csv file or paste its content. The first row is treated as the column titles and is always kept; untick the option if your file has none.
  2. Tick the columns that define a duplicate (all by default), and choose whether case and surrounding spaces matter.
  3. Check the removed rows, then download the cleaned file, with the separator of the original. The removed rows can be downloaded too.

Example

Input

Email,Name,City
ana@example.com,Ana,Boston
bob@example.com,Bob,Denver
ana@example.com,Ana,Boston
ana@example.com, Ana ,Boston

Output

Email,Name,City
ana@example.com,Ana,Boston
bob@example.com,Bob,Denver

Good to know

  • Rows are compared cell by cell on the selected columns; “Jean-Pierre” and “Jean Pierre” are still different.
  • Kept rows stay exactly as they were, spaces included, even when spaces are ignored for the comparison.
  • Blank rows at the end of the file are dropped.

Frequently asked questions

How do I remove duplicate rows from a CSV file?

Drop the .csv file or paste its content: by default a row is a duplicate when all its cells match an earlier row. The header row is always kept, the removed rows are listed, and the cleaned file keeps the original separator.

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

Untick every column except Email: two rows with the same address are then duplicates even if the name or the city differs. You can tick several columns, for example last name and first name together.

How do I remove duplicates from a CSV in Excel?

Excel has Data > Remove Duplicates. But saving a CSV from Excel can alter it: leading zeros of zip codes or phone numbers disappear and some values turn into dates. Here the kept rows are written back exactly as they were.

Which copy of a duplicate is kept?

The first occurrence by default, which keeps the original order. Choose “Last occurrence” when later rows are more recent, for instance when an export is appended to an older one.

Are “Ana” and “ ana ” counted as duplicates?

Spaces at the start and end of cells are ignored by default, so “ Ana ” matches “Ana”. Case matters by default: tick “Ignore case” so that “ANA” and “ana” match too. “Jean-Pierre” and “Jean Pierre” always stay different.

How do I remove duplicate rows from a CSV in Python?

With pandas: pd.read_csv('in.csv').drop_duplicates().to_csv('out.csv', index=False), and drop_duplicates(subset=['Email']) for one column. This page gives the same result without code, and shows the rows it removed.

← Back to all tools