AIExplainer
Machine Learning Intermediate 1 min read

What is Levenshtein Distance?

A measure of the difference between two sequences of characters

Pronunciation: LEH-ven-shtine

The Levenshtein Distance is a way to calculate how similar or different two strings of text are. It counts the number of single-character edits (insertions, deletions or substitutions) needed to change one string into the other.

Imagine you have two recipes written in different ways, but with similar ingredients. The Levenshtein Distance is like counting the number of steps you need to take to transform one recipe into the other by adding, removing or replacing ingredients.

A spell checker uses the Levenshtein Distance to suggest corrections for misspelled words by finding the closest match in its dictionary.

The Levenshtein Distance is used in many applications such as spell checkers, plagiarism detection, and data compression to compare and measure the similarity between strings of text.

Some people think the Levenshtein Distance only measures the number of differences between two strings, but it actually measures the minimum number of operations needed to transform one string into the other.

The Levenshtein Distance was developed by Vladimir Levenshtein in 1965 as a way to measure the distance between two strings of characters.

Edit Distance String Distance

Three products for different needs — explore what’s relevant to you.