Levenshtein Distance Calculator
Type two strings to get the Levenshtein edit distance: the smallest number of single character inserts, deletes or substitutions that turns one into the other. A similarity percentage and the comparison length update as you type.
How to measure edit distance
- Type or paste the first string into the top box.
- Type or paste the second string into the bottom box.
- Read the edit distance, similarity percent and longest length below.
Examples
Classic kitten to sitting
kitten / sitting
distance 3, similarity 57.14%, max length 7
Identical strings
hello / hello
distance 0, similarity 100%, max length 5
Frequently asked questions
What is edit distance?
Edit distance is the minimum number of single character changes needed to turn one string into another. The Levenshtein variant allows three operations, each costing one: insert a character, delete a character, or substitute one character for another.
How is the similarity percentage calculated?
Similarity is 1 minus the edit distance divided by the length of the longer string, shown as a percent. So kitten versus sitting is 1 minus 3 over 7, about 57.14%. Two identical or two empty strings score 100%.
Does it handle Unicode and emoji?
Yes. Strings are compared by Unicode code point, so an emoji or accented letter counts as a single character. Swapping one emoji for another is one edit, not several.
Is the comparison case sensitive?
By default yes, so Hello and hello differ by one edit. Turn on the ignore case option to treat upper and lower case as equal.
What is Levenshtein distance used for?
It powers spell checkers, fuzzy search, deduplicating near-identical records, DNA sequence comparison, and scoring how close a guess is to an answer.
Is my text private?
Yes. The calculation runs entirely in your browser. Nothing you type is uploaded or stored on a server.
Related tools
Diff Checker
Compare two blocks of text or code line by line. See added, removed and unchanged lines with color highlighting. Free, fast and runs in your browser.
Palindrome Checker
Check if a word, number, or phrase is a palindrome. Ignore case, spaces, and punctuation, then see the normalized text. Free, instant, and private.
Word Counter
Free online word counter. Paste text to count words, characters, sentences, paragraphs and reading time instantly. Works in your browser and stays private.
Add Line Numbers
Add line numbers to any text online. Set the start value, step, and separator, pad numbers to align, and copy or download the result. Free and private.
Bullet List Maker
Turn lines of text into a bullet or numbered list online. Pick dash, asterisk, dot, arrow or numbers, add indent, then copy. Free and private.
Caesar Cipher
Encode and decode text with the Caesar shift cipher. Pick any shift, see the result live, and brute force all 25 shifts. Runs entirely in your browser.