Remove duplicate table rows

Clean Excel/CSV data, keep first or last duplicates, and export removed records.

  • Runs locally
  • Free

Use the tool

Your files are processed in your browser and are not uploaded to a server.

About this tool

Remove duplicate rows from Excel or CSV tables, judging by all columns or a combined key, keeping the first or last occurrence, and export the removed records separately for review.

Typical uses

  • De-duplicate a customer list by phone number
  • Remove duplicates by order number plus SKU
  • Clean repeats after merging several exports

How to use

  1. Upload CSV/TSV/TXT or XLSX, or paste text. Choose text encoding, delimiter or worksheet, then check the first 20 rows and header setting.

  2. Use all columns or a combined key, keep first or last occurrences and optionally clean whitespace and blank rows. Inspect retained rows, removed records and changes, then export CSV/XLSX.

Example

Import an XLSX order sheet, select the order ID column and keep the last occurrence. Optionally trim whitespace, inspect retained and duplicate records with source positions, then export each as XLSX. Choose GB18030 / GBK explicitly for legacy Chinese CSV files and verify the preview.

Good to know

Text files: 5 MB, UTF-8, GB18030/GBK or UTF-16 LE/BE. XLSX: 10 MB, 50 MB expanded. Up to 20,000 records, 200 columns, 200,000 cells and 10 MB output. IDs stay text; formulas use cached results without recalculation or formatting. CSV formula protection is on by default. Presets match unique column names with headers; missing or duplicate names block processing. Headerless tables use positions. Reselect columns and update older presets.

Last means position in the file, not the most recent date. Deduplication uses selected columns and explicit rules; presets match unique column names. IDs remain text and cleanup is off by default. XLSX uses formula caches without recalculation or display formatting; originals are unchanged.

When two rows count as duplicates

For each record the tool takes the columns chosen under “Compare columns” and builds a comparison key from their values as written. Records are duplicates only when the keys are identical. “All columns” requires every cell in the row to match; “Selected columns (combined key)” looks only at the ticked columns. Out of the box, only “Ignore surrounding whitespace when comparing” is on: nothing converts full-width characters, number formats or accents. Each verdict below comes from running the tool on two values in the same column.

Value AValue BDefault settingsWith “Ignore case when comparing”With “Collapse spaces / tabs (preserve line breaks)”Why
“A001”“a001”differentduplicatedifferentCase matters by default.
“␣A001”“A001”duplicateduplicateduplicateLeading and trailing spaces are ignored for the comparison; the cell itself is not changed.
“[U+3000]A001”“A001”duplicateduplicateduplicateThe CJK full-width space (U+3000) also counts as surrounding whitespace.
“A001[NBSP]”“A001”duplicateduplicateduplicateThe non-breaking space that often comes with text copied from web pages is ignored too.
“Mei␣␣Chen”“Mei␣Chen”differentdifferentduplicateDouble spaces inside a value are not surrounding whitespace. Only the collapse cleanup option makes them equal, and it also rewrites the exported value.
“A001”“A001”differentdifferentdifferentFull-width letters and digits are not folded to their ASCII forms.
“アイウ”“アイウ”differentdifferentdifferentHalf-width and full-width katakana are different characters.
“001”“1”differentdifferentdifferentIDs are compared as text, so leading zeros count.
“1,000”“1000”differentdifferentdifferentThousands separators are not removed.
“caf锓cafe”differentdifferentdifferentAccented and unaccented letters differ.
“caf锓cafe[U+0301]”differentdifferentdifferentBoth look like “café”, but one uses a single precomposed é and the other e plus a combining accent.
(empty)(empty)duplicateduplicateduplicateTwo empty keys are equal, so all records with an empty ID collapse into one.
  • With “Ignore surrounding whitespace when comparing” switched off, “␣A001” and “A001” are different.
  • Empty keys matching each other is the opposite of the rule in Merge and match spreadsheets, where a blank key never matches. If an empty ID means “not assigned yet” rather than “same person”, filter those rows out first or compare on All columns.
  • To make full-width or unpadded IDs comparable, normalise them first in the table field standardizer: its half-width rule turns “A001” into “A001”, and a pad rule with width 3 turns “1” into “001”. Then deduplicate.
  • While “First row is a header (never cleaned or deduplicated)” is ticked, row 1 is always kept and never compared.
  • Ignoring case uses plain lower-casing, so “STRASSE” and “straße” remain different.

Keeping the first or the last occurrence: an order list worked through

“Keep which record” is decided by position in the file only, never by a date column. In the order list below the key is the order column. The first column is the record number the tool uses, with the header counted as record 1.

RecordorderstatusupdatedFirst occurrenceLast occurrence
21001paid2026-11-01keptremoved, kept record → 5
31002paid2026-11-02keptkept
41001shipped2026-11-03removed, kept record → 2removed, kept record → 5
51001refunded2026-10-30removed, kept record → 2kept
  • With First occurrence the output order is 1001, 1002; with Last occurrence it is 1002, 1001. A kept record stays where it was, so keeping the last occurrence moves 1002 ahead of 1001.
  • Last occurrence keeps record 5, dated 2026-10-30, which is older than record 4. To keep the most recent status, sort by date ascending in Filter, sort and summarize tables first, then choose Last occurrence.
  • Kept rows and removed rows download separately as CSV or XLSX. The source file is never modified.

The “Removed records” report adds three columns before the original ones. This is the export for Last occurrence. Record numbers include the header, and a record whose cell contains a line break still counts once, so the numbers can differ from a text editor’s line numbers.

Source recordKept recordReasonorderstatusupdated
25Duplicate1001paid2026-11-01
45Duplicate1001shipped2026-11-03

How values are read from CSV and XLSX

CSV, TSV and TXT files are decoded strictly in the encoding chosen under “Text file encoding”: UTF-8, GB18030 / GBK, UTF-16 LE or UTF-16 BE. The tool does not guess. This is what actually happens when the choice is wrong:

File is reallyEncoding chosenResult
GBK (text “张三”)UTF-8Cannot decode using this encoding. Choose the correct encoding and read again; invalid bytes are not silently replaced.
UTF-8 (text “张三”)GB18030 / GBKNo error; read as: “寮犱笁”
UTF-8 with BOMGB18030 / GBKThe file BOM does not match the selected encoding. Choose its UTF-8 or UTF-16 encoding.
UTF-16 LE without BOMUTF-8Cannot decode using this encoding. Choose the correct encoding and read again; invalid bytes are not silently replaced.
Windows-1252 (text “café”)UTF-8Cannot decode using this encoding. Choose the correct encoding and read again; invalid bytes are not silently replaced.
UTF-8 with BOMUTF-8BOM removed; read as: “id”

The second row is the one to watch: UTF-8 bytes happen to be valid GBK, so there is no error, only garbled text such as “寮犱笁” in the preview. Always glance at the preview after reading. There is no Windows-1252 / Latin-1 option, so older Western-European CSV files need re-saving as UTF-8 first. A wrong delimiter is silent too: a semicolon-separated file read with commas shows 1 column with each whole line in one cell; switch “Text delimiter” to Semicolon.

From XLSX the tool reads the stored value and the cached result of each formula, not what the cell displays. That decides which IDs are treated as equal:

Cell in ExcelValue the tool reads
Number 1 shown as 001 with the custom format 000“1”
001 typed into a text-formatted cell“001”
Date 2026-11-20“2026-11-20T00:00:00.000Z”
A floating-point result such as =0.1+0.2“0.30000000000000004”
Formula =B2*2 with saved result 84“84”
Formula without a cached result (generated by a script, never calculated)A formula has no cached result. Recalculate and save in Excel or compatible software first.
Number 12345678901234567890 (20 digits)The workbook contains an unsafe numeric value. Store long IDs as text in the source file and try again.
Logical TRUE“true”
Error value #N/AThe workbook contains an error cell. Correct it before importing.

So in one column a number displayed as 001 and the text 001 read as “1” and “001” and are not duplicates. Dates come out as UTC ISO timestamps, which never equal a CSV date written 11/20/2026. Store long account or card-style numbers as text in Excel before importing.

Messages, and what happens on export

MessageUsual causeWhat to do
Cannot decode using this encoding. Choose the correct encoding and read again; invalid bytes are not silently replaced.The file uses another encoding: a GBK file read as UTF-8, or a Windows-1252 CSV.Pick another encoding and read again. Windows-1252 files must be re-saved as UTF-8.
The file BOM does not match the selected encoding. Choose its UTF-8 or UTF-16 encoding.The file starts with a UTF-8 or UTF-16 byte-order mark but another encoding is selected.Choose the encoding the BOM indicates.
Invalid CSV. Check quoting and the delimiter.A quote is never closed, or the delimiter does not match.Check quoted cells and the delimiter.
Select at least one column. Preset column names must exist uniquely in the current table.Selected columns (combined key) is chosen with nothing ticked, or a preset column name is missing or duplicated in this table.Tick at least one column or rebind the preset.
The workbook contains an unsafe numeric value. Store long IDs as text in the source file and try again.The workbook holds an integer beyond JavaScript’s safe range (more than 15–16 digits).Format the column as text in the source and re-enter or re-import.
A formula has no cached result. Recalculate and save in Excel or compatible software first.A formula has never been calculated and saved.Open, recalculate and save in Excel or a compatible app.
The workbook contains an error cell. Correct it before importing.A cell holds #N/A, #REF! or another error value.Fix or clear it in the source.
Limit: 20,000 rows, 200 columns and 200,000 cells including headers.The data is above the local processing limit.Split the table, deduplicate each part, then combine.
Text input limit: 5 MB.A CSV / TSV / TXT file is over 5 MB (XLSX allows 10 MB).Split the file or use XLSX.

“CSV formula protection (prefix risky values; XLSX always exports text)” is on by default for CSV downloads. A value that starts with =, +, - or @ and is not a plain number gets a leading apostrophe so a spreadsheet app will not run it as a formula. Plain numbers, including negatives and numbers with a leading +, stay as they are:

Cell valueValue in the exported CSVWhy
=SUM(A1:A9)'=SUM(A1:A9)Formula, prefixed
-5-5Negative number, unchanged
+8613800000000+8613800000000Plain number, unchanged
+86 138 0000 0000'+86 138 0000 0000Has spaces, not a plain number, so prefixed
@user'@userStarts with @, prefixed
1e51e5Number in scientific notation, unchanged

To keep leading zeros and long IDs in Excel, download XLSX instead: every value is written as text there, so formula protection is not needed.

Frequently asked questions

How do I dedupe by specific columns?

Choose one or more columns as a combined key; only rows identical in those columns count as duplicates.

Can I see removed rows?

Yes. Removed records are listed and can be exported.

Will IDs turn into scientific notation?

No. IDs stay text, and CSV formula protection is on by default.