Skip to content
Allin

The Number 1 and the Text "1" Are Not Duplicates

Published 9/1/2026 · 4 min read · File tools

Daniel Okonkwo

Daniel OkonkwoFront-end developer and tech writer at Allin

Web performance · File formats

Checked against 3 sources

View profile
In short

The tool keeps the first occurrence of every distinct row and drops the rest, comparing the full tuple of cells rather than any single key column — so two customers with the same name but different addresses both survive, which is what you want. What surprises people is that the comparison is exact and typed. Running it over five rows that all display as 1, a — the number 1, the text "1", the number again, the same number written 1.0, and the text " 1" with a leading space — leaves three: the number, the plain text and the spaced text are three different rows, while 1 and 1.0 are the same number and collapse. That is not a defect; it is the only comparison that cannot silently merge two records that differ. It does mean that a column imported as text from one file and as numbers from another will not deduplicate against itself, and the fix is upstream: make the column one type before you merge, not after.

Deduplication compares whole rows exactly, cell type included. Five identical-looking rows came out as three, because one held a number, one a string and one a string with a leading space.

Where the mixed types come from

Almost always from an import. A CSV has no types at all — every field is text until something decides otherwise — so the program that opened it guessed, and it guesses differently depending on the column's first rows, the locale and whether a value has a leading zero or a currency sign. Reference numbers are the usual casualty: 00412 is text in one file because the zero must be kept and the number 412 in another because it looked numeric. Merge those two and the same reference is two rows.

The other source is invisible whitespace. A trailing space survives a copy-paste from a web page, a PDF or an email, and it makes two otherwise identical cells different for every exact comparison — deduplication here, but also lookups, joins and pivot tables everywhere else. Cleaning it is a find-and-replace before the merge, and it is worth doing on any column you intend to match on.

Whole rows, not a key column

Comparing the whole row is the conservative choice and worth understanding as one. Two rows that agree on the reference number but differ in one address field are kept, because the tool cannot know which of the two addresses is current — deciding that is a judgement about your data, not an operation on it. If you want to deduplicate on a single column, sort by that column first and remove the extras yourself; the result is the same and the decision stays yours. The header row is never treated as a duplicate of anything, so a file whose first row repeats a value from the body keeps both.

Five rows that all display as 1, a — three survive
Cell as storedKept or droppedWhy
number 1KeptFirst occurrence
text "1"KeptA string is not a number
number 1 againDroppedSame as the first row
number 1.0DroppedThe same number written differently
text " 1" with a spaceKeptA different string
Remove duplicate rowsDelete rows that repeat an earlier row exactly, keeping the header and the first occurrence. Works with Excel (XLSX, XLS, XLSM, XLSB), OpenDocument (ODS), Apple Numbers, CSV and TSV.Try the tool

Frequently asked questions

Which of the duplicates is kept?
The first one in the file, in the order the rows appear. Everything after it is dropped. If the rows differ in a column you did not think to look at, the one kept is the earliest, not the best — so if recency matters, sort the sheet before you deduplicate rather than after.
How do I make a mixed column one type?
Decide which type the column really is and convert the whole thing in one operation before merging. Reference numbers, postcodes and phone numbers are text — they have leading zeros and are never added up. Amounts and counts are numbers. In a spreadsheet, format the column, then use a text-to-columns pass or a helper column with TEXT or VALUE to force every cell across; formatting alone does not change what is stored.
Does it look across the sheets of a workbook?
It works on one sheet at a time, which is what you want when tabs hold different things. To deduplicate across several files or tabs, merge them into a single sheet first — the row merge stacks every file's rows into one table and keeps only the first header — and then run this on the result.

Articles you may find interesting

All guides
ExplainerConverting Formulas to Values Keeps the Cached Answer, Not the CalculationA spreadsheet file stores both the formula and the last answer Excel computed. Stripping the formula leaves the stored answer — and leaves a blank wherever the file never carried one.ComparisonXLS, XLSX, XLSM and XLSB: Which Is Which, and Which You WantFour extensions, three of them the same box with different lids. Rename an XLSX to .zip and it opens — that single fact explains the whole family, and explains why XLS, which does not, is the one still causing trouble.ExplainerWhy Your CSV Breaks Accents and Dates in ExcelThree completely different faults hide behind the same sentence. One is the encoding, one is the separator, one is Excel guessing at types while it opens the file — and the fix for each is different. Here is how to tell them apart in five seconds.How-toExtracting the Text from a PDF, and What the Layout Does to ItA PDF stores glyphs at coordinates — not lines, not paragraphs, not a reading order. Extraction rebuilds the text from those positions, which is why two columns come out interleaved, a table loses its cells, and a scan gives you nothing at all. Measured by running the tool.How-toSRT to Text: Getting a Clean Transcript Out of SubtitlesRemoving the numbers and the timestamps is the easy half. The half that decides whether the transcript is readable is the italic tags, the dialogue dashes, the sound descriptions and the sentences broken across two cues — and this converter leaves every one of them for you.ComparisonZIP or TAR: Which One, and Why It MattersOne structural difference explains everything else: TAR does not compress, it only stacks; ZIP compresses each file on its own. Measured on 60 small source files, that is the difference between 1,809 bytes and 14,686.

Related tools

Sources

Spotted a mistake in this article?