FuzzyWuzzy.ratio using python-Levenshtein doesn't return the Levenshtein score, but rather the Levenshtein ratio, which is (a+b - LevenshteinScore)/(a+b), where a and b are the lengths of the two strings being compared.

If you don't have python-Levenshtein installed then fuzzywuzzy doesn't use Levenshtein at all. Fuzzywuzzy's home page is misleading with regards to this, though it does recommend installing python-Levenshtein.

python-Levenshtein has some issues with installing; I used the second response to this stackoverflow question to solve it.

If you don't have python-Levenshtein installed FuzzyWuzzy uses difflib instead, which is the same for many input values, but not all. The developers recommend using python-Levenshtein. See this issue on fuzzywuzzy's git, which includes an example case where the results are different with the package as compared to without it. This probably shouldn't happen, or at least the documentation should make this clear, but FuzzyWuzzy's Devs seem content at least with the functionality.

Answer from Isaac on Stack Overflow
🌐
PyPI
pypi.org › project › fuzzywuzzy
fuzzywuzzy · PyPI
It uses Levenshtein Distance to calculate the differences between sequences in a simple-to-use package. ... python-Levenshtein (optional, provides a 4-10x speedup in String Matching, though may result in differing results for certain cases)
      » pip install fuzzywuzzy
    
Published   Feb 13, 2020
Version   0.18.0
🌐
Medium
medium.com › analytics-vidhya › fuzzy-matching-in-python-2def168dee4a
Levenshtein Distance and the concept of Fuzzy matching in Python | by Sreemanto Kesh | Analytics Vidhya | Medium
May 2, 2020 - And this is achieved by making use of the Levenshtein Distance between the two strings. fuzzywuzzy is an inbuilt package you find inside python which has certain functions in it which does all this calculation for us.
🌐
Analytics Vidhya
analyticsvidhya.com › home › fuzzywuzzy python library: interesting tool for nlp and text analytics
FuzzyWuzzy Python Library: Interesting Tool for NLP and Text Analytics
October 16, 2024 - The FuzzyWuzzy python library uses Levenshtein distance to calculate the difference between two strings. Let's understand it
🌐
DataCamp
datacamp.com › tutorial › fuzzy-string-python
Fuzzy String Matching in Python Tutorial | DataCamp
January 15, 2026 - It is also possible to calculate the Levenshtein similarity ratio based on the Levenshtein distance. This can be done using the following formula: where |a| and |b| are the lengths of a sequence and b sequence, respectively. One of the most popular packages for fuzzy string matching in Python was historically FuzzyWuzzy.
Top answer
1 of 2
7

FuzzyWuzzy.ratio using python-Levenshtein doesn't return the Levenshtein score, but rather the Levenshtein ratio, which is (a+b - LevenshteinScore)/(a+b), where a and b are the lengths of the two strings being compared.

If you don't have python-Levenshtein installed then fuzzywuzzy doesn't use Levenshtein at all. Fuzzywuzzy's home page is misleading with regards to this, though it does recommend installing python-Levenshtein.

python-Levenshtein has some issues with installing; I used the second response to this stackoverflow question to solve it.

If you don't have python-Levenshtein installed FuzzyWuzzy uses difflib instead, which is the same for many input values, but not all. The developers recommend using python-Levenshtein. See this issue on fuzzywuzzy's git, which includes an example case where the results are different with the package as compared to without it. This probably shouldn't happen, or at least the documentation should make this clear, but FuzzyWuzzy's Devs seem content at least with the functionality.

2 of 2
1

Found an excellent article from the creator of FuzzyWuzzy here.

String Similarity The simplest way to compare two strings is with a measurement of edit distance. For example, the following two strings are quite similar: NEW YORK METS NEW YORK MEATS Looks like a harmless misspelling. Can we quantify it? Using python’s difflib, that’s pretty easy

from difflib import SequenceMatcher 
m = SequenceMatcher(None,"NEW YORK METS", "NEW YORK MEATS") 
m.ratio() ⇒ 0.962962962963 

So it looks like these two strings are about 96% the same. Pretty good! We use this pattern so frequently, we wrote a helper method to encapsulate it

fuzz.ratio("NEW YORK METS", "NEW YORK MEATS") ⇒ 96
🌐
Medium
medium.com › @alphaiterations › fuzzy-matching-with-fuzzywuzzy-a-comprehensive-guide-04873f07de31
Fuzzy Matching with FuzzyWuzzy: A Comprehensive Guide | by Alpha Iterations | Medium
April 30, 2024 - There are various fuzzy string matching algorithms available. ... If python-Levenshtein library is already installed in your system, FuzzyWuzzy uses Levenshtein distance at the backend.
🌐
CRAN
cran.r-project.org › web › packages › fuzzywuzzyR › readme › README.html
fuzzywuzzyR - README - R Project
The fuzzywuzzyR package is a fuzzy string matching implementation of the fuzzywuzzy python package. It uses the Levenshtein Distance to calculate the differences between sequences.
🌐
Anki
strikingloo.github.io › fuzzywuzzy-python-string-distance
FuzzyWuzzy: How to Measure String Distance in Python
April 15, 2019 - The minimum amount of these operations that need to be done to u in order to turn it into v, correspond to the Levenshtein distance between those two strings. ... Where i and j are indexes to the last character of the substring we’ll be comparing. The second term in the last expression is equal to 1 if those characters are different, and 0 if they’re the same. This is the measure Python’s FuzzyWuzzy library uses.
Find elsewhere
🌐
GeeksforGeeks
geeksforgeeks.org › python › fuzzywuzzy-python-library
FuzzyWuzzy Python Library - GeeksforGeeks
January 9, 2026 - FuzzyWuzzy is a Python library for fuzzy string matching that uses Levenshtein Distance to compare two strings and returns a similarity score from 0 to 100.
🌐
Mlampros
mlampros.github.io › fuzzywuzzyR
Fuzzy String Matching • fuzzywuzzyR
Fuzzy string matching implementation of the fuzzywuzzy python package. It uses the Levenshtein Distance to calculate the differences between sequences.
🌐
Medium
medium.com › analytics-vidhya › clean-matching-with-fuzzywuzzy-c19bb8a9f197
Clean Matching with FuzzyWuzzy. String Matching in Python with use of… | by Stephanie Bourdeau | Analytics Vidhya | Medium
January 9, 2020 - Fuzzywuzzy makes use of the Levenshtein distance through it’s ratio function that calculates the character differences between two strings.
🌐
GitHub
github.com › seatgeek › fuzzywuzzy › issues › 91
Fuzzywuzzy 4x slower *with* python-Levenshtein installed · Issue #91 · seatgeek/fuzzywuzzy
August 26, 2015 - According to the intro page: "python-Levenshtein (optional, provides a 4-10x speedup in String Matching)" I am fuzzy matching paragraphs with their best match from a significant list of paragraphs. When I use fuzzywuzzy without python-Le...
Author   seatgeek
🌐
GitHub
github.com › seatgeek › fuzzywuzzy › issues › 318
Installing python-Levenshtein as suggested by the warnings gives different results. · Issue #318 · seatgeek/fuzzywuzzy
July 22, 2021 - At fuzzywuzzy version 0.18.0, it gives the answer of 100. It also gives the following user warning. UserWarning: Using slow pure-python SequenceMatcher. Install python-Levenshtein to remove this warning warnings.warn('Using slow pure-python SequenceMatcher.
Author   seatgeek
🌐
Readthedocs
sphobjinv.readthedocs.io › en › latest › levenshtein.html
Speeding up “suggest” with python-Levenshtein (DEPRECATED) — sphobjinv 2.3.2.dev0 documentation
fuzzywuzzy uses difflib.SequenceMatcher from the Python standard library for its fuzzy searching. While earlier versions of sphobjinv were able to make use of fuzzywuzzy‘s optional link to python-Levenshtein, a Python C extension providing similar functionality, due to a licensing conflict this is no longer possible.
🌐
Towards Data Science
towardsdatascience.com › home › latest › string matching with fuzzywuzzy
String Matching With FuzzyWuzzy | Towards Data Science
January 28, 2025 - Instead of trying to format the strings in order to match, Fuzzywuzzy uses a some similarity ratio between two sequences and returns the similarity percentage. For a more detailed description, take a look over the documentation. Let’s start by importing the necessary libraries and go over a simple example. Although it isn’t required, python-Levenshtein is highly recommended with FuzzyWuzzy.
🌐
Pub.dev
pub.dev › packages › fuzzywuzzy
fuzzywuzzy | Dart package
August 15, 2024 - This is a Dart port of the popular FuzzyWuzzy python package. This algorithm uses Levenshtein distance to calculate similarity between strings.
Published   Mar 27, 2021
Version   1.2.0
🌐
Typesense
typesense.org › posts › fuzzy string matching in python (with examples)
Fuzzy string matching in Python (with examples) | Typesense
Like the python-Levenshtein library, it also has a ratio function: from fuzzywuzzy import fuzz str1 = 'But I have promises to keep, and miles to go before I sleep.' str2 = 'But I have many promises to keep, and miles to run before sleep.' ratio = fuzz.ratio(str1, str2)
🌐
Built In
builtin.com › data-science › fuzzy-matching-python
Fuzzy String Matching in Python: Intro to Fuzzywuzzy | Built In
FuzzyWuzzy is a Python library that uses Levenshtein distance to calculate the differences between sequences and patterns. It was developed and also open-sourced by SeatGeek, a service that finds event tickets from all over the internet and ...
🌐
Neudesic
neudesic.com › blog › fuzzywuzzy-using-python
FuzzyWuzzy Using Python - Neudesic
July 2, 2024 - There are four popular types of fuzzy matching logic supported by the FuzzyWuzzy Python library: Ratio – uses pure Levenshtein Distance based matching
🌐
Libhunt
python.libhunt.com › compare-fuzzywuzzy-vs-python-levenshtein
fuzzywuzzy vs Levenshtein | LibHunt
Compare fuzzywuzzy and Levenshtein's popularity and activity. Categories: Text Processing and General. fuzzywuzzy is more popular than Levenshtein.