Home › Developer Tools › Remove Duplicates in Excel

Remove Duplicates in Excel

Open an Excel or CSV file, pick the columns that define a duplicate and remove the repeated rows, highlight them in red, or pull out only the duplicates. You can keep the first or the last copy, ignore letter case and stray spaces, and download a clean .xlsx.

Last updated:

Compare these columns
What to do with duplicates
Which copy to keep
Matching

Advertisement
Advertisement

How to use the Remove Duplicates in Excel

  1. Open your file by dropping it on the box or clicking it. A sample customer list is loaded so you can see how it works.
  2. Pick the worksheet if the workbook has several, and untick the header option if row 1 is data.
  3. Choose the columns to compare: leave all selected to find fully identical rows, or select only a key such as Email.
  4. Choose the action (remove, highlight or keep only duplicates) and whether to keep the first or the last copy.
  5. Check the preview: duplicates are shown in red with the row they repeat.
  6. Download the cleaned file as .xlsx or CSV.

How duplicates are detected

For every data row the tool builds a key from the columns you selected. Two rows are duplicates when their keys are equal. With all columns selected that means the whole row matches; with one column selected only that value has to match. The first row with a given key (or the last, if you choose so) is the one that is kept; every other row with the same key is a duplicate of it.

Values are compared as they appear in the cell: numbers by value (5 and 5.0 are equal), dates by their date and time, and text character by character, optionally ignoring case and repeated or surrounding spaces. Rows whose key columns are all empty are skipped unless you untick the blank-row option.

Example: one key column versus all columns

RowEmailPlanCompare all columnsCompare Email only
2[email protected]ProKeptKept
3[email protected]FreeKeptKept
4[email protected]ProDuplicate of row 2Duplicate of row 2
5[email protected]ProKept (plan differs)Duplicate of row 3

Choose Keep last occurrence in the second case and row 5 (the Pro plan) is kept instead of row 3, which is the usual choice when later rows hold newer information.

Doing it in Excel itself

  • Remove: select the range, then Data > Remove Duplicates, and tick the columns to compare. Excel always keeps the first occurrence and changes your sheet in place.
  • Highlight: Home > Conditional Formatting > Highlight Cells Rules > Duplicate Values. This colours every occurrence, including the first, and works on single cells rather than whole rows.
  • Formula: in Excel 365, =UNIQUE(A2:E100) returns the distinct rows of a range, and =COUNTIFS(A:A,A2)>1 flags rows whose value in column A appears more than once.

This tool gives the same result without touching the original workbook, and adds keep-last, case/space-insensitive matching and a status column that names the row each duplicate repeats.

Frequently asked questions

How do I remove duplicate rows from an Excel file?

Open the file, leave all columns selected under Compare these columns and keep Remove duplicate rows chosen. Every row that is identical to an earlier row is dropped and the first copy is kept. Click Download cleaned file to save the result as .xlsx or CSV.

How do I remove duplicates based on one column only?

Click None under Compare these columns and tick just the column that should be unique, such as Email or Order ID. Rows are then treated as duplicates when that column matches, even if other columns differ, and only the first (or last) row for each value is kept.

What is the difference between keeping the first and the last occurrence?

When several rows share the same key, Keep first keeps the one nearest the top of the sheet and Keep last keeps the one nearest the bottom. Keeping the last copy is useful when newer records are appended at the end, for example to keep the latest address for each customer.

Can I highlight duplicates instead of deleting them?

Yes. Choose Highlight duplicates: all rows are kept, the repeated copies are filled light red in the downloaded .xlsx and a Duplicate status column says which row each one repeats. CSV files cannot store colours, so the status column is the marker there.

Why are two rows that look the same not detected as duplicates?

They usually differ in hidden ways: extra spaces, different capitalisation, a number stored as text, or a date with a time part. Turn on Ignore upper/lower case and Ignore spaces, and check that the values really are identical in the preview. Dates are compared by their calendar value, so 2025-01-04 and 2025-01-04 13:30 are different.

Does this work like Excel's Remove Duplicates button?

It follows the same rule as Data > Remove Duplicates in Excel (a row is removed when the selected columns match an earlier row), but adds options Excel lacks: keeping the last copy, ignoring case and spaces, highlighting instead of deleting, and extracting only the duplicated rows. Your original file is never changed.

Is my spreadsheet uploaded?

No. The file is read and processed with JavaScript in your browser and the cleaned file is created on your device, so customer lists and other private data stay with you.

Are all the tools on FreeToolCabin tested for quality and accuracy?

Yes! Every tool on our site undergoes automated Q/A testing in real browser environments to ensure high precision, correct output, and zero errors. If you happen to spot a bug or have a suggestion, please contact us at [email protected] and our team will review it right away.

Related tools

Merge Excel FilesCombine XLSX, XLS and CSV files into one workbook or append all rows into a single sheet.CSV Duplicate Row RemoverRemove duplicate rows from a CSV by all or selected columns and download the cleaned file.Excel Viewer (XLSX / XLS)Open XLSX, XLS and ODS spreadsheets in your browser without Excel.Remove Duplicate LinesDelete duplicate lines from any list, ignoring case or spaces, keep first or last, and sort.Count Duplicate LinesCount how many times each line appears, sorted by frequency, with duplicates-only and CSV export.JSON to Excel ConverterTurn JSON into a styled .xlsx spreadsheet; nested arrays become their own linked sheets.JSON to CSVConvert JSON data to CSV for spreadsheets.CSV to JSONConvert CSV data to JSON with live preview.Excel to CSVConvert XLSX spreadsheets to CSV.CSV ViewerOpen a CSV or TSV file as a sortable, filterable table.Line Ending ConverterConvert text and files between CRLF, LF and CR line endings.Markdown to HTMLConvert Markdown to clean HTML with a live editor.XML to JSONConvert XML to JSON with validation.Text Encoding ConverterDetect and convert text file encodings like UTF-8, UTF-16 and Latin-1.JSON ViewerExplore JSON as a collapsible tree, search keys and values and copy any node's path.TTF to WOFF2 ConverterConvert TTF and OTF fonts to WOFF2 or WOFF and get a ready @font-face CSS snippet.Chmod CalculatorConvert Linux file permissions between checkboxes, octal (755) and symbolic (rwxr-xr-x) notation.JSON to TypeScriptGenerate TypeScript interfaces or types from JSON, with nested types and optional fields.Morse Code TranslatorTranslate text to Morse code and back, then play it as sound or a blinking light, or save a WAV.HTML Table GeneratorBuild HTML tables in an editable grid with styles, header rows, CSV import and live preview.Hex to Text ConverterConvert hex to text and text to hex with UTF-8 support and space, 0x, \x or comma formats.JSON to XML ConverterConvert JSON to well-formed XML with attributes, arrays and pretty print.JSON to YAML ConverterConvert JSON to clean YAML as you type, with indent, quoting and sort options.YAML to JSON ConverterConvert YAML to pretty or minified JSON, with errors pinned to the exact line.HTML to Markdown ConverterTurn HTML or pasted rich text into clean Markdown with tables and live preview.Markdown Table GeneratorBuild Markdown tables in a grid or paste from Excel/CSV, with alignment and preview.JSON ValidatorCheck JSON with the exact line and column of each error, fix tips and one-click auto-fix.Image to Base64Convert images to Base64 data URIs, CSS backgrounds and HTML img tags in your browser.Base64 to ImagePaste a Base64 string or data URI to preview, identify and download the image.JSON CompareCompare two JSON documents and see every added, removed and changed path.Hex to DecimalConvert hex to decimal instantly with steps and signed mode.Decimal to HexConvert decimal to hex instantly with steps and signed mode.Binary to DecimalConvert binary to decimal instantly with steps and signed mode.Decimal to BinaryConvert decimal to binary instantly with steps and signed mode.Two's Complement CalculatorDecimal to two's complement binary and back for 4-64 bits, with invert-and-add-1 steps.XML to CSV ConverterConvert XML to CSV: detects repeating records, flattens nested data, pick your columns.CSV to XML ConverterConvert CSV to well-formed XML with custom root and row names, escaping and pretty print.TOML to JSON ConverterConvert TOML to JSON and JSON to TOML with a full v1.0 parser and clear error lines.SQL Online CompilerRun SQL queries online on SQLite with sample databases, a result grid, CSV export and .db save.SQL to ER DiagramPaste CREATE TABLE statements and get an entity-relationship diagram with keys and links.XML to XSD GeneratorGenerate an XML Schema (XSD) from sample XML: types, occurrences, attributes and namespaces.XML ValidatorCheck if XML is well-formed, see the exact line and column of each error and pretty-print it.Wildcard Mask CalculatorConvert a subnet mask or CIDR to a wildcard mask for ACLs and OSPF, with range and binary.CSV to VCF ConverterConvert a contacts CSV into a vCard (.vcf) file, mapping columns to name, phone, email and more.CSV to YAML ConverterConvert CSV rows to a YAML list of mappings with type inference and delimiter detection.Endianness ConverterSwap byte order of 16, 32 and 64-bit hex values and see big- and little-endian integers and floats.Excel to SQL ConverterTurn an Excel sheet into CREATE TABLE and INSERT statements for MySQL, PostgreSQL, SQLite or SQL Server.Excel to VCF ConverterTurn an Excel contact list into a vCard .vcf file for iPhone, Android, Google or Outlook.File to C ArrayConvert any file into a C or C++ byte array header, like xxd -i, with const and PROGMEM options.Image to C ArrayConvert images to monochrome, RGB565 or RGB888 C arrays for OLED, LCD and TFT displays.JSON Merge ToolDeep-merge two or more JSON objects with array concat, replace or union and a conflict rule.JSONL to CSV ConverterConvert JSON Lines / NDJSON to CSV with flattened columns; streams large files locally.PHP Unserialize OnlineDecode PHP serialize() strings to JSON, a tree or print_r, and serialize JSON back to PHP.SQL Dialect ConverterTranslate SQL between MySQL, PostgreSQL, SQLite, SQL Server, Oracle, BigQuery and more.TSV to JSON ConverterTurn tab-separated data pasted from Excel or Sheets into a JSON array or keyed object.XLS to XLSX ConverterConvert old Excel 97-2003 .xls workbooks to modern .xlsx files in your browser, several at once.XML to Excel ConverterTurn repeating XML elements into an .xlsx spreadsheet with attributes and nested data as columns.XSD to XML Sample GeneratorGenerate a sample XML document from an XSD schema, with types, attributes and namespaces.YAML to CSV ConverterTurn a YAML list of objects into CSV with dot-notation columns, custom column order and download.DOCX to Markdown ConverterConvert Word .docx to clean Markdown with headings, lists, tables, links and images in a ZIP.ES6 to ES5 ConverterTranspile modern JavaScript (ES2015+) to ES5 with Babel: targets, module format and loose mode.JavaScript Object to JSONTurn JS object literals and Python dicts into valid JSON: quotes keys, fixes commas and values.JSON Graph VisualizerSee JSON as an interactive node graph with zoom, collapse and search; export PNG or SVG.KML ViewerOpen KML and KMZ files on an interactive map: placemarks, paths, polygons, folders, export.MySQL to PostgreSQL ConverterConvert MySQL dumps and CREATE TABLE statements to PostgreSQL: types, AUTO_INCREMENT, ENUMs, quotes.Text to CSV ConverterTurn space-aligned, fixed-width, pipe or tab separated text into clean CSV with a live preview.VCF File ViewerOpen vCard .vcf files as contact cards with photos, search and duplicate check, export CSV.XML ViewerBrowse XML as a collapsible tree with search, XPath of any node, attributes and big-file support.
See all 129 Data & File Format Converters →