Levenshtein Distance
Counts how many edits turn one string into another: the edit list, a similarity percentage, and the matrix with explanations.
How to turn the first line into the second
Matrix
Rows are the characters of the first line, columns of the second. Click a cell to see how the number was computed.
Levenshtein distance is the smallest number of edits that turns one string into another. There are three kinds of edits: insert a character, delete one, or replace one. Between "plan" and "planet" the distance is 2: you insert "e" and "t".
How the similarity percentage is calculated
The distance is divided by the largest value possible for strings of that length, and the result is subtracted from one. For "kitten" and "sitting" that gives 1 − 3/7, about 57%. The formula with the actual numbers appears under the result.
The matrix
Turn on "matrix with explanations" to see the calculation table. Each cell holds the distance between the beginnings of the two strings, and the path to the answer is highlighted. Click a cell, and below the table you'll see which neighboring cells the number came from and which edit was chosen.
Rate this tool
Help us get better
Tell us what was missing.
Other tools
Cyrillic Transliteration
Converts Cyrillic text to translit, right in the browser.
Character Counter
Characters, words and paragraphs, platform limits and reading time.
Spell Checker
Typos and repeated words with replacement options, in Russian and English.
Create Text File
A text file from what you typed, with a choice of encoding
Text Diff Checker
Differences between two text versions, including the invisible edits
Markdown Editor
Markup on the left, result on the right, notes as a separate list
Case Converter
Every case at once: plain-text cases plus camelCase, snake_case, kebab-case
Reading Time Calculator
Reading time silent and aloud, with pauses, plus a label for the article