CalcWorldHub
Free online calculator · no signup

Unicode Levenshtein edit distance calculator

Count the fewest single-code-point edits needed to turn one text string into another.

4,000 tools
Unicode Levenshtein edit distance calculator — First text, Second text and calculation method
Unicode Levenshtein edit distance calculator: inputs and calculation method.

How to use this calculator

Count the fewest single-code-point edits needed to turn one text string into another.

  1. Enter First text, Second text. Match the units shown beside each field and review the result together with the assumptions below.
  2. Read the worked example below to check the expected input format and result.
  3. Compare another scenario by changing one input at a time. Use Reset to return to the starting values.
Calculation guide

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.

Levenshtein distance3edits
Changing “kitten” to “sitting” takes three code-point edits: one substitution and two substitutions in the minimum-cost sequence.

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.