Converter tool

Fuzzy Match Two CSV Files on Names or Codes

Match the rows of one file to the most similar rows of another by Jaro-Winkler, token-set or edit distance, with blocking for speed, a review band for uncertain pairs and a joined CSV or XLSX export.

Left file gets the matches

1. Your two files

Left file (every row keeps its place)

Or paste the table

Right file (searched for matches)

Or paste the table

Fuzzy Match Two CSV Files

Operator: Abdulla Al Fahad. How tools are built and checked

A customer list says Initech LLC, the billing export says Initec, and an exact lookup returns nothing. This page takes every row of a left file, searches a second file for the closest candidates and attaches the best one with its score. With the company name at weight 1 and the city at weight 0.5, Jaro-Winkler at a 0.90 threshold links 13 of the 15 customers in the bundled example in one pass. Token-set at the same threshold links 8 and sends 5 to review, and Levenshtein links 4 and sends 3.

Key features

  • One to three column pairs with weights; a pair that is blank on either side is left out of that row's weighted mean
  • Jaro-Winkler, token-set and Levenshtein similarity, each scored from 0 to 1
  • A match threshold and a lower review floor, so scores in between wait for your decision
  • Blocking by shared word start or by the first three letters, chosen automatically by file size, or all pairs
  • Optional one-to-one assignment so a right row is not given to several left rows
  • Left, inner or full outer output with status, score, runner-up score, an ambiguity flag and a score per column pair, as CSV or as XLSX with COUNTIF summary formulas

Similarity methods, blocking and what happens to uncertain pairs

Load two tables, .csv, .tsv or .xlsx (first sheet), with a header row and up to 100,000 rows each. Choose one to three column pairs, one column from each file per pair, and give each pair a weight. Values are lower-cased and trimmed, punctuation is dropped unless you turn that off, and runs of spaces collapse; accents are not folded, so é and e count as different letters.

How it works

Candidates come from blocking on the first column pair only. In shared-word mode a row joins a block for the first two letters of each word of two or more letters; in first-letters mode it joins the block of the first three characters of its whole value. Automatic mode compares every pair when left rows times right rows is 1,000,000 or fewer, otherwise uses shared-word blocking, and falls back to first letters if the estimate passes 8,000,000 comparisons. If even that is too many the page stops and says so.

Jaro-Winkler counts characters that match within half the longer length, penalises transpositions and adds a bonus for a shared start of up to four characters. Levenshtein similarity is 1 minus the edit distance over the longer length. Token set compares the words both values share, in sorted order, with each side's remaining words; the score is the best of three Ratcliff-Obershelp ratios, the same recipe as the fuzzywuzzy library's token_set_ratio, so word order and extra words such as Inc cost almost nothing.

A pair's score is the weighted mean of its column scores. For each left row the four best candidates at or above the review floor are kept; the best becomes the match, and its distance from the runner-up (within 0.02 is flagged as a close call) is recorded. In one-to-one mode, all kept candidates are sorted by score and handed out from the top, so a right row goes to the left row it resembles most.

Common use cases

  • Reconciling a CRM export of 15 customers with a billing system where Tyrell Corporation is billed as Tyrel Corp and Oscorp Industries as Oscorp, then using the city as a second pair to confirm each link.
  • Matching 2,400 event sign-ups to 18,000 donors on name (weight 1) and postcode (weight 2). That is 43.2 million pairs, so automatic mode switches to shared-word blocking instead of comparing them all.
  • Linking a supplier's product list to your own catalogue by description, where the supplier adds words like 'pack of 6'. Token set ignores the extra words, and the review band catches the lookalikes.

How to use this tool

  1. Drop the left file, whose rows you want to keep, and then the right file.
  2. Pick the matching column in each file, and add a second pair such as city if names alone are risky.
  3. Choose a method, then set the match threshold and the review floor below it.
  4. Press Find matches, read the counts and tick the review pairs that are truly the same entity.
  5. Choose left, inner or full output and download the joined CSV or XLSX.

Example

Left customer and right billing names, company weight 1 and city weight 0.5, match at 0.90, review down to 0.75, one-to-one

Left customer          Right billed_to
Acme Corporation       ACME Corp
Initech LLC            Initec
Stark Industries       Stark Industries Ltd
Umbrella Group         (no similar name)

Status and score by method

Acme Corporation -> ACME Corp:   Jaro-Winkler 0.94 matched, token set 0.81 review, Levenshtein below the floor
Initech LLC -> Initec:           Jaro-Winkler 0.94 matched, token set 0.80 review, Levenshtein below the floor
Stark Industries -> Stark Industries Ltd: Jaro-Winkler 0.97 matched, token set 1.00 matched, Levenshtein 0.87 review
Umbrella Group:                  unmatched under all three

Common pitfalls

Blocking can hide true matches. Shared-word blocking never compares Bob with Robert, and first-letters blocking never compares Smith with Smyth because their first three letters differ. Turn blocking off when the files are small enough.

One-to-one assignment is greedy. A left row can lose its best partner to a higher-scoring row even when a different overall pairing would have scored better, so use it for tidy lists, not for a global optimum.

Short codes score high on every measure. A100 against A101 is 0.75 under Levenshtein and 0.88 under Jaro-Winkler, so a threshold tuned for names will accept different part numbers. Match codes on their own pair with a threshold near 1.

  • Put the most distinctive column first, because it alone decides which rows are compared. Name first and city second at weight 0.5 works; the reverse would block on city and compare every company in the same town.
  • Token set forgives suffixes but not spelling: on the name alone Initech LLC against Initec scores only 0.71, where Jaro-Winkler gives 0.91. Run both on company names and compare what lands in review.

Common errors and how to fix them

Choose a column on both sides for every pair, or remove the pair.
A pair with an empty side cannot be scored. Pick the column in both files or press Remove on that pair.
That would need about 400,000,000 comparisons (the limit is 8,000,000).
Too many candidate pairs even after blocking. Split the files by region or letter, or move a more selective column into the first pair.
The review floor must be above 0 and no higher than the match threshold.
Set the review floor at or below the match level, for example 0.75 under 0.90, or make them equal to switch the review band off.

Best practices

  • Look at the close-call count in the summary. Those rows have a runner-up within 2 points of the best, so the match is close to a coin toss even if it cleared the threshold.
  • Read the per-pair score columns in the export before trusting a link: a row can reach 0.9 with a perfect city and a weak name.

Working through the review band

Token set at 0.90 with a floor of 0.75 puts five of the fifteen example links in review: Acme Corporation to ACME Corp (0.81), Globex Inc. to Globex Incorporated (0.83), Initech LLC to Initec (0.80), Soylent Corp to Soylent Corporation (0.85) and Tyrell Corporation to Tyrel Corp (0.81). All five are the same company, and the same city on both sides confirms it.

Ticking a pair changes its status in the export from review to matched (review accepted). Pairs left unticked stay as review (not accepted) with the right-hand columns blank, so nothing unverified is joined.

Frequently asked questions

Why does one pair get a different score under each method?

They measure different things. On the name alone, Hooli against Hooli Inc is 1.00 for token set (the shared word is everything in one value), 0.91 for Jaro-Winkler (the extra characters cost a little) and 0.56 for Levenshtein (four edits over nine characters). Pick the method whose idea of difference matches your data.

How is this different from Fuzzy Duplicate Finder and Join CSV?

Fuzzy Duplicate Finder looks for near-duplicates inside one file, and Join CSV needs identical keys. This page links two different files on similar keys, attaching each left row's best candidate with its score. If every chosen column is blank for a left row, no candidates are compared and the row is unmatched.