Tools › Numerical Methods › Data Tools › Fuzzy Duplicate Finder › Method
Fuzzy Duplicate Finder: Method
Open the free Fuzzy Duplicate Finder (Name Matching)
Fuzzy Duplicate Finder: Grouping Records That Are Nearly the Same
The tool takes a pasted list of names (suppliers, customers, products, codes), scores how alike every pair is, links the pairs at or above a threshold and returns the groups of linked records. A group is a set of records to look at, not a finding that they are the same.
The idea: a number for "nearly the same", and a line drawn through it
Two records that a person reads as one business rarely agree character for character: one has a suffix, one is in capitals, one has two letters swapped. A similarity measure turns a pair of names into a number from 0 (nothing alike) to 1 (identical). Everything else follows from one choice, the threshold: pairs at or above it are linked, and records joined by links form a group.

Step 1: normalization
Before any comparison each name is reduced to a key. With every option on: accented Latin letters become their base letters (é to e, ß to ss); letters become lower case; an ampersand becomes the word "and"; apostrophes and periods are removed, so that L.L.C. reads llc; every other character that is not a letter or a digit becomes a space; runs of spaces become one; and the words of the ignore list (Inc, LLC, Co, Ltd and the like, and the filler words the, and, of) are dropped. A name made only of ignored words keeps them. Records with the same key are "the same after normalization" and need no further comparison: "Tri-County Paper" and "Tri County Paper Co" both have the key "tri county paper". Each option can be turned off, and the list of ignored words is yours to edit.
Step 2: three similarity measures
| Measure | Formula | What it is good at |
|---|---|---|
| Jaro | J = ( m / |a| + m / |b| + (m − t) / m ) / 3 | m: characters the two names share no more than floor(max(|a|, |b|) / 2) − 1 positions apart, each used once; t: half the number of shared characters that are out of order |
| Jaro-Winkler | JW = J + L × 0.1 × (1 − J) | L: length of the common beginning, at most 4. Typing errors in short names; an error at the start of a name costs more than one at the end |
| Levenshtein similarity | S = 1 − d / max(|a|, |b|) | d: fewest single-character insertions, deletions and substitutions. Easy to explain; a swapped pair of letters costs 2 |
| Token-set similarity | S of the two names after the words of each are sorted and repeats dropped | Words in another order ("Supply Harbor Point"); weak when one word is split or joined ("Iron Wood" against "Ironwood") |
Worked by hand for MARTHA and MARHTA: all six characters are shared (m = 6); read in order, T and H are exchanged, two positions out of order, so t = 1. J = (6/6 + 6/6 + 5/6) / 3 = 0.944. The common beginning is MAR (L = 3), so JW = 0.944 + 3 × 0.1 × 0.056 = 0.961. The edit distance is 2 (two substitutions), so the Levenshtein similarity is 1 − 2/6 = 0.667: the measure that knows about transpositions scores this pair far higher. The page shows the same steps for one pair of your list.
The Jaro and Jaro-Winkler values of the page reproduce, to the three printed digits, the Jaro and Wink columns of Table 2.1 of Winkler (1994) for all 24 pairs of names of four or more characters (SHACKLEFORD and SHACKELFORD 0.970 and 0.982, JONES and JOHNSON 0.790 and 0.832, MARHTA and MARTHA 0.944 and 0.961). That table prints 0.000 for two pairs of three-character strings because the Census production routine returns zero for such short strings; the page applies the formula at every length. The further adjustments of the Census comparator, for characters that look alike and for long names, are not applied.
Step 3: which pairs are compared
Up to 40,000 pairs (about 280 distinct names) every pair is scored. Beyond that the count of pairs grows with the square of the list and the page compares only candidate pairs: names that share a word (a word found in very many names is not used for this), and names that stand within six places of each other when the list is sorted from the front, sorted from the back, and sorted by its sorted words. This is called blocking. It never adds a wrong link, and it can miss a right one: two similar names that share no word and do not sort near each other, such as two one-word names that differ in the middle, are never compared. In a test list of 934 names, blocking scored 8 % of the pairs and found 528 of the 534 linked pairs. The results say which case applied. The comparison also stops at a time budget, and says so.
Step 4: groups, chains and the strict rule
With the connected rule, two records are in one group whenever a chain of linked pairs joins them. Chains are the known weakness: A is like B, B is like C, C is like D, and A ends in a group with D though the two have little in common. The page therefore prints the lowest similarity inside every group and marks a group "chained" when that value is under the threshold. The strict rule takes the links strongest first and lets a link join two groups only when every pair across them is at or above the threshold, so that no group is chained; the price is that the result depends on the order of the links, and a record that sits between two groups goes to one of them.
For each group the page names a suggested form: the text that occurs most often, on a tie the longest, then the first in the list. It is a suggestion of form only.
With a second list, only pairs of one record from each list are compared, and a group is reported when it holds records of both lists. Extra columns (a city, a postal code) can be required to agree before two records are compared at all, or can count toward the score: score = (1 − w) × name similarity + w × mean similarity of the extra columns filled in both records.
What it assumes
That likeness of spelling is evidence of sameness; that the differences the normalization sets aside (case, punctuation, legal suffixes) carry no meaning in your list; that one threshold suits the whole list; and that each line is one record with the name in one piece.
When it misleads
Names that differ in a digit or a short word are nearly identical as strings and mean different things: "Hex Bolt M8 x 40" and "Hex Bolt M8 x 45", "Westbrook Chemical" and "Eastbrook Chemical", branch 12 and branch 21. One business can trade under names with nothing in common, and no string measure will find that. Short names give coarse scores: one changed letter in a four-letter name moves the Levenshtein similarity by 0.25. Jaro on long names can pair a character with a far-away twin and report characters out of order where a reader sees one substitution. A low threshold with the connected rule builds chains. With long lists, blocking leaves some pairs uncompared.
Common mistakes
- Merging every group without reading it. The page groups; it does not decide.
- Reading a similarity as a probability. 0.90 is not "90 % sure".
- Using one threshold for every measure: 0.90 on Jaro-Winkler is far looser than 0.90 on Levenshtein, because the prefix bonus and the gentle treatment of transpositions lift Jaro-Winkler scores.
- Counting transpositions as whole swaps in the Jaro formula: t is half the number of characters out of order.
- Dividing the edit distance by the shorter length, or by the sum of the lengths, and comparing the result with a threshold meant for the longer-length form.
- Leaving the legal suffix in: "Inc" against "LLC" then separates two records of one business, and "Company" lifts the similarity of two unrelated ones.
- Forgetting that the suggested form is only the most frequent spelling in the list, which can be the misspelled one.
Related tools
Bank Reconciliation matches two pasted lists by amount and date; this tool matches by the text of a name, which that tool uses only to break ties. Data Summary and Outliers screens a column of numbers before analysis; this tool screens a column of names. The Plot Digitizer is the other data-preparation tool of the section.