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 texts or files side by side or unified, with word and character highlighting, ignore whitespace or case, collapse unchanged, and .diff export.
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.
Acronym Generator
Turn any phrase into an acronym from the first letter of each main word. Skip small words like the and of, keep them, or add dot separators.
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.
AI Sentiment Analyzer
Analyze the sentiment of any text with AI in your browser. Paste a review or comment, get a positive or negative score plus a per-sentence breakdown.