Boneyard Tools

Levenshtein Distance Calculator

Type two strings to get the Levenshtein edit distance: the smallest number of single character inserts, deletes or substitutions that turns one into the other. A similarity percentage and the comparison length update as you type.

How to measure edit distance

  1. Type or paste the first string into the top box.
  2. Type or paste the second string into the bottom box.
  3. Read the edit distance, similarity percent and longest length below.

Examples

Classic kitten to sitting

kitten / sitting
distance 3, similarity 57.14%, max length 7

Identical strings

hello / hello
distance 0, similarity 100%, max length 5

Frequently asked questions

What is edit distance?

Edit distance is the minimum number of single character changes needed to turn one string into another. The Levenshtein variant allows three operations, each costing one: insert a character, delete a character, or substitute one character for another.

How is the similarity percentage calculated?

Similarity is 1 minus the edit distance divided by the length of the longer string, shown as a percent. So kitten versus sitting is 1 minus 3 over 7, about 57.14%. Two identical or two empty strings score 100%.

Does it handle Unicode and emoji?

Yes. Strings are compared by Unicode code point, so an emoji or accented letter counts as a single character. Swapping one emoji for another is one edit, not several.

Is the comparison case sensitive?

By default yes, so Hello and hello differ by one edit. Turn on the ignore case option to treat upper and lower case as equal.

What is Levenshtein distance used for?

It powers spell checkers, fuzzy search, deduplicating near-identical records, DNA sequence comparison, and scoring how close a guess is to an answer.

Is my text private?

Yes. The calculation runs entirely in your browser. Nothing you type is uploaded or stored on a server.

Related tools