Remove CSV duplicates by selected columns
Choose which columns define a duplicate. Keep the first or last matching row without deleting cells from the middle of a record.

Choose files or try the synthetic example.
Some cells start with characters that a spreadsheet may interpret as formulas, including minus signs. Quoting a CSV cell does not prevent formula execution. Only open files from sources you trust. Values have not been changed.
How to use this tool
- Choose a UTF-8 CSV file and its separator, then read the columns.
- Select the columns that define a duplicate. Select all columns to compare entire rows. Choose first or last occurrence in file order.
- Remove duplicates, compare the removed-row count with your expectation, and download the result.
Try a small example
The synthetic example contains two rows with id 001 and one with id 002. Select only id and keep the first occurrence. Two data rows remain, and id 001 keeps the name Ada. Selecting every column keeps all three rows because the names differ.
What to check before downloading
Matching is exact and case-sensitive. Spaces, blank values and leading zeros are significant. Blank keys match other blank keys. Last means last in file order, not the newest date. The tool does not sort or guess which record is correct.
The preview shows the first five data rows and eight columns, with cells shortened to 120 characters. Downloads contain the full result. Output uses UTF-8, commas, quoted fields and CRLF record endings. Your original files stay unchanged.
How do I keep the newest duplicate?
First sort your source by a verified date column, oldest to newest. Then use last occurrence. This tool does not parse dates, so it cannot establish which row is newest on its own.
Will Excel keep my leading zeros?
These tools preserve text such as 001 and long identifiers in the downloaded CSV. A spreadsheet can still convert them when opening it. Import identifier columns as text. A CSV cannot restore digits that were already lost.
Related tools and guides
- Merge CSV files online by column name
- Split CSV into smaller files with headers
- Find invisible spaces that stop values from matching
- CSV import troubleshooting guides
Sources
- RFC 4180: CSV quoting and record structure
- Microsoft: leading zeros and large numbers
- OWASP: spreadsheet formula interpretation in CSV files
Testing notes
Automated JavaScript tests cover quoted fields, embedded line breaks, Unicode, malformed records, column matching and output row counts. The tools operate on CSV text. They do not test Excel or Google Sheets import behavior.