How to use this calculator
Count the fewest single-code-point edits needed to turn one text string into another.
- Enter First text, Second text. Match the units shown beside each field and review the result together with the assumptions below.
- Read the worked example below to check the expected input format and result.
- Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Unicode Levenshtein edit distance explained
Levenshtein distance counts the fewest insertions, deletions, and substitutions needed to transform one input into the other. This implementation compares Unicode code points exactly; it does not normalize accents or treat a multi-code-point grapheme sequence as one character.
Inputs, symbols, and units
a— First text- First text. An empty string is a valid byte sequence.
b— Second text- Second text. An empty string is a valid byte sequence.
Formula and method
Minimum unit-cost insertion, deletion and substitution edits
Start with the costs of inserting an empty prefix into the second text. For each next code point, take the minimum cost of deletion, insertion, or a matching/substituting diagonal step. Only the preceding dynamic-programming row is stored.
A worked scenario
First text = kitten; Second text = sitting.
- Levenshtein distance: 3 edits
This scenario uses the stated units and assumptions. Displayed values are rounded only after calculation.
Assumptions and edge cases
Case sensitive, no Unicode normalization, and no transposition shortcut. Up to 500 Unicode code points per input.
Frequently asked questions
Are emoji one character?
A Unicode code point is counted; multi-code-point emoji sequences can count as several.
Does swapping adjacent letters cost one?
No, this is Levenshtein rather than Damerau–Levenshtein distance.
Are accents normalized?
No, visually similar encodings can differ.
How do I use the Unicode Levenshtein edit distance calculator?
Enter First text, Second text. Match the units shown beside each field and review the result together with the assumptions below.
What is a worked example of Unicode Levenshtein edit distance?
First text = kitten; Second text = sitting. Levenshtein distance: 3 edits This scenario uses the stated units and assumptions. Displayed values are rounded only after calculation.
Read our calculation methodology.