Skip to content

ML Models & Algorithms

Fuzzy Matching / Fuzzy String Matching

In shortScoring how similar two strings are when they are not identical, to catch typos and variants; it compares characters, not meaning.

Updated 24 Oct 2026· 2 min read

Fuzzy matching (or fuzzy string matching) measures how alike two pieces of text are when they are not exactly the same, and turns that into a similarity score. It catches typos, spelling variants and small differences, which makes it ideal for redirect maps, 404 clean-ups and de-duplicating messy data. It works on characters, so it has no understanding of meaning.

How it works

String matching has been studied since at least the 1980s, and methods differ in how they calculate similarity. MLforSEO groups them into five approaches:

In Python you mostly reach for libraries that bundle these. RapidFuzz is the current default; TheFuzz, the renamed FuzzyWuzzy, now runs on RapidFuzz; and PolyFuzz lets you compare several models side by side.

How it’s used in SEO and marketing

  • Redirect mapping during migrations and 404 clean-ups, matching old URLs or titles to the closest live page.
  • Competitor metadata analysis, comparing titles to find overlap and gaps.
  • Mapping keywords to seed terms or topics as a lightweight first pass.
  • Finding misspelled brand mentions and normalising product names or campaign names across platforms.
  • Building internal-link shortlists for a human to review.

Example

By raw Levenshtein distance, HARD and HAND are more similar than HARD and HARDER (one substitution versus two insertions), although a human reads HARD and HARDER as far more related. RapidFuzz’s normalised fuzz.ratio disagrees, scoring HARD/HARDER at 80 and HARD/HAND at 75. Neither understands meaning; they just measure spelling differently, which is why you check which scorer your library uses before setting a threshold.

Limitations and things to watch

  • No semantics: it is the wrong tool for keyword clustering or judging whether two pages are genuinely related. Use an entity or embedding approach for that.
  • Thresholds need calibrating on a sample, and every match list needs human review.
  • Comparing every item against every other grows quickly; use whole-matrix functions such as RapidFuzz’s process.cdist for large lists.
  • Clean inputs first: lowercase, strip domains and tracking parameters, and compare like with like.

Learn it on MLforSEO

Sources and further reading

Other terms from ML Models & Algorithms

See all 55 ML Models & Algorithms terms →