3 edits (insertions, deletions, or substitutions) turn String A into String B.
About Levenshtein Distance Calculator – Edit Distance
Levenshtein distance — also called edit distance — counts the smallest number of single-character insertions, deletions, or substitutions needed to turn one string into another. It's the math behind fuzzy search, spell-checkers, typo detection, and "did you mean…?" suggestions.
This free Levenshtein distance calculator compares two strings live and reports both the raw edit distance and a similarity percentage, so you can see at a glance how close two pieces of text are. It's handy for deduplicating near-identical records, scoring fuzzy matches, or just understanding how the algorithm scores a pair of words.
Everything runs entirely in your browser. Your strings never leave the device — no upload, no tracking, fully offline once the page has loaded.
Features
- Live edit distance as you type, with a similarity percentage and bar
- Counts Unicode by code point, so emoji and astral characters score as one unit
- Symmetric, classic dynamic-programming algorithm — accurate and fast
- Runs offline in the browser; nothing is uploaded
How to use
- Type or paste your first string into the String A field.
- Enter the second string into the String B field.
- Read the edit distance (the big number) and the similarity percentage and bar below.
Frequently asked questions
What is Levenshtein distance?
It is the minimum number of single-character edits — insertions, deletions, or substitutions — required to change one string into another. For example, turning "kitten" into "sitting" takes 3 edits, so their Levenshtein distance is 3.
How is the similarity percentage calculated?
Similarity is 1 − distance / maxLength, where maxLength is the length of the longer string. Identical strings score 100%, and two strings that share no characters at the same scale score 0%. Two empty strings are treated as identical (100%).
How are emoji and accented characters counted?
This calculator measures distance over Unicode code points rather than UTF-16 units, so an emoji or other astral character counts as a single edit unit — matching what most people perceive as one character.
Is Levenshtein distance the same as a diff?
They are related but different. Levenshtein gives a single number describing how far apart two strings are at the character level. A text diff shows you exactly which lines or words changed. Use Levenshtein for fuzzy matching and scoring; use a diff to review changes.
Are my strings sent anywhere?
No. The entire calculation happens locally in your browser using JavaScript. Nothing you type is uploaded, logged, or stored, and the tool works offline.
Related tools
Everything runs locally in your browser — your input is never uploaded.