Levenshtein Edit Distance Calculator
Minimum insert/delete/substitute edits between two strings — plus normalized similarity for fuzzy matching and WER.
The classic example: kitten → sitting is 3 edits (k→s, e→i, +g). Edit distance powers spell-checkers, fuzzy search, DNA alignment and is the basis of Word Error Rate (WER) for speech recognition when applied to word sequences.
Formula
About Levenshtein Edit Distance Calculator
Levenshtein edit distance counts the minimum single-character edits — insertions, deletions, substitutions — needed to transform one string into another. It's the engine behind spell-checkers, fuzzy search, autocorrect, record deduplication, DNA sequence alignment, and (applied to word tokens) the Word Error Rate that benchmarks speech recognition. This calculator computes the exact distance via the classic dynamic-programming algorithm and a normalized similarity percentage for thresholding fuzzy matches. The textbook kitten→sitting example (3 edits) is the default.
How to use Levenshtein Edit Distance Calculator
- 1Enter your values into Levenshtein Edit Distance Calculator — sensible, domain-typical defaults are pre-filled so you see a real result immediately.
- 2The result recomputes live using the formula shown on the page; there is no button to press.
- 3Adjust any input to compare scenarios, then read the worked example to see the substituted numbers.
Why use Levenshtein Edit Distance Calculator?
- ✓Computes Levenshtein Edit Distance instantly in your browser — no sign-up, no upload, no server round-trip.
- ✓100% free and unlimited, with the exact formula shown: Levenshtein(A,B) = min insertions + deletions + substitutions to turn A into B.
- ✓Runs entirely client-side, so every value you enter stays private on your device.
- ✓Live recompute as you type, with a worked example and authoritative references for trust.
Frequently asked questions
How is edit distance computed efficiently?+
Dynamic programming: build an (m+1)×(n+1) table where each cell is the distance between prefixes, filled via the recurrence min(delete, insert, substitute). It runs in O(m·n) time and O(min(m,n)) space with the rolling-row optimization — fast enough for words and short strings, the basis of every fuzzy-match library.
What's the difference between Levenshtein and Damerau-Levenshtein?+
Damerau-Levenshtein adds a fourth operation: transposition of two adjacent characters as a single edit (so 'teh'→'the' costs 1, not 2). It better models human typos and is preferred for spell-checking. Plain Levenshtein (this tool) treats a transposition as two substitutions.
How does edit distance relate to Word Error Rate (WER)?+
WER is Levenshtein distance computed over WORD tokens instead of characters, divided by the number of reference words: (S+D+I)/N. It's the standard ASR metric. So this same algorithm, applied to word sequences and normalized by reference length, gives you WER — the metric for transcription accuracy.
Should I use raw distance or normalized similarity for matching?+
Normalized similarity (1 − dist/maxlen) for thresholding across strings of different lengths — a distance of 2 means very different things for a 4-letter vs 40-letter string. Use raw distance when comparing fixed-length strings or when the absolute number of edits is what matters (e.g. a typo budget).
Related ML & AI tools
ROC-AUC Calculator (from TPR/FPR points)
Trapezoidal area under the ROC curve from your (FPR, TPR) operating points — the threshold-independent ranking score.
● LiveClassification Threshold Cost Calculator
Find the probability cutoff that minimizes expected cost given your false-positive and false-negative penalties.
● LiveSilhouette Score Calculator
Cluster cohesion vs separation for one point — the building block of the silhouette metric for choosing K.
● Live