Skip to main content
NyankoTools

String Similarity & Edit Distance Calculator

Measures how alike two strings are with Levenshtein edit distance and a similarity percentage, and lists the inserts, deletes, and replacements that turn one into the other. To see line-by-line changes instead, use the Text Diff Checker.

🔒 Runs in your browser · Your data is never sent to a server

Enter two strings to see the result.

Notes

  • Edit distance is the minimum number of single-character inserts, deletes, and replacements needed to turn A into B.
  • Similarity is 1 - (edit distance / length of the longer string). Two empty strings count as 100%.
  • The step list is one of the possible minimal sequences; a different sequence with the same count can exist.
  • To keep the page responsive, each string is limited to 5000 characters.
  • "Graphemes (visible characters)" counts combining marks and emoji sequences as one character. If your browser does not support it, code points are used.
  • Everything runs entirely in your browser - the strings you enter are never sent to a server.

FAQ

What is Levenshtein edit distance?

It is the minimum number of single-character inserts, deletes, and replacements needed to turn string A into string B. "kitten" to "sitting" takes two replacements and one insert, so the distance is 3.

How is the similarity percentage calculated?

It is 1 - (edit distance / length of the longer string). For "kitten" and "sitting" that is 1 - 3/7, about 57.1%. Two empty strings give 100%; one empty string gives 0%.

How are emoji and combining characters counted?

By default, code points are counted, so a surrogate-pair emoji is one character. An "e" plus a combining accent is two, so choose "Graphemes (visible characters)" to count what you actually see.

What does "adjacent swap counts as 1" mean?

Turning "ab" into "ba" costs 2 in plain Levenshtein distance, but 1 if swapping two neighboring characters counts as one step. This variant suits typo detection.

Can I compare long strings?

Each string can be up to 5000 characters. The work grows with the product of the two lengths, so longer input could freeze the browser.

Share this page

↑↓ Select Enter Open Esc Close