About the Levenshtein Distance Calculator
The Levenshtein distance is the fewest single-letter edits needed to turn one text into another, where an edit is an insert, a delete or a swap of one letter. This calculator gives the distance, the length of each text and a similarity percentage, which helps judge how close two words are. Type two words or texts and the Levenshtein distance appears at once, with a few related figures underneath, and you can copy the result with one tap. The sums run in your browser, so nothing you enter is uploaded.
Updated October 2026
How to use the Levenshtein Distance Calculator
- 1Enter two words or texts.
- 2Pick the units or options from the menus if the Levenshtein distance tool offers them.
- 3Read the Levenshtein distance in the large result box.
- 4Look at the extra rows for related figures.
- 5Press Copy result to keep the answer.
When you need the Levenshtein distance
Developers use it for spell checkers, search suggestions and duplicate detection. Researchers use it to compare DNA or names.
The distance depends on the lengths, so the similarity percentage is easier to compare between pairs. A distance of 1 is a single typo.
How the Levenshtein distance is worked out
Fill a table where each cell is the smallest of: the cell above plus 1, the cell on the left plus 1, and the diagonal cell plus 0 or 1 depending on whether the letters match. kitten becomes sitting in 3 edits: change k to s, change e to i, and add g at the end. The similarity is 1 − 3 ÷ 7 = 57.1%.
Every answer on this page comes from that one rule, so you can check any result by hand with a calculator. The figures shown underneath, such as other units, are conversions of the same answer.
- Distance and similarity
- Case sensitive
- Both texts shown
Mistakes to avoid with Levenshtein distance
The tool is case sensitive, so lower the case first if you want to ignore it. Very long texts are slow to compare, so it has a size limit.
On phone and computer
On a phone, type into the boxes one after another and read the Levenshtein distance underneath; Copy result puts it on the clipboard for a message or a note. On a computer the inputs sit on the left and the answer on the right, so you can change one figure and watch the Levenshtein distance move. The levenshtein distance calculator works the same on both.
Checking your Levenshtein distance by hand
A good habit is to test the levenshtein distance calculator with a case you already know. kitten becomes sitting in 3 edits: change k to s, change e to i, and add g at the end. The similarity is 1 − 3 ÷ 7 = 57.1%.
If your own figures give a surprising answer, repeat the working yourself: Fill a table where each cell is the smallest of: the cell above plus 1, the cell on the left plus 1, and the diagonal cell plus 0 or 1 depending on whether the letters match. Small differences usually come from rounding, from mixing units, or from a typing slip in one of the inputs. Edit distance counts insertions, deletions and swaps. For strings of equal length, the Hamming Distance Calculator is simpler. The Anagram Checker tests whether two words use the same letters, and the Palindrome Checker tests whether a word reads the same backward.
Features
- Case matters
- Long texts are slow
- Compare similarity for different lengths
- Clear messages when the Levenshtein distance inputs make no sense
- Copy the result with one tap
- Private: nothing is uploaded
Frequently asked questions
How do I calculate Levenshtein distance?
Fill a table where each cell is the smallest of: the cell above plus 1, the cell on the left plus 1, and the diagonal cell plus 0 or 1 depending on whether the letters match. kitten becomes sitting in 3 edits: change k to s, change e to i, and add g at the end. The similarity is 1 − 3 ÷ 7 = 57.1%.
What is the formula for Levenshtein distance?
Fill a table where each cell is the smallest of: the cell above plus 1, the cell on the left plus 1, and the diagonal cell plus 0 or 1 depending on whether the letters match. The levenshtein distance calculator applies it exactly and rounds only the displayed answer to six significant figures.
What counts as an edit?
Inserting, deleting or replacing one character.
How is it different from Hamming distance?
Hamming needs equal lengths and counts only replacements.
Is the order important?
No. The distance from A to B equals that from B to A.
Is this levenshtein distance calculator free and private?
Yes. It is free, needs no account and runs in your browser, so the numbers you type are not uploaded or stored.