# String distance calculators

Also sometimes known as edit distance. Quantifying the difference between two strings is useful for a number of applications in information theory, linguistics, and computer science. There are three main algorithms:

### Levenshtein distance

Levenshtein distance is the number of single-letter **insertions, deletions or substitutions** required to change one string into the other.

### Damerau-Levenshtein distance

Damerau-Levenshtein distance is like Levenshtein distance, **but also allows transpositions**. The Damerau-Levenshtein distance between *goat* and *gaot* is therefore 1: the one transposition of *o* with its neighboring *a*).

### Hamming distance

Hamming distance uses **only substitutions** when calculating the number of operations needed to change one string into the other: no deletions, insertions, or transpositions. The two strings given to the Hamming distance algorithm must therefore be of equal length.