String Similarity
Compare two strings by Levenshtein, Damerau, Jaro–Winkler, Dice and Hamming, with each insertion, deletion and substitution marked — live as you type.
a→b is a substitution, an underlined character is inserted, a struck-through one is deleted, and the rest is kept.
The edit distance is the minimum number of single-character insertions, deletions, or substitutions to turn one string into the other. Similarity is 1 − Levenshtein distance ÷ the length of the longer string, counted in characters: 100% is identical. Upper and lower case count as different characters.
Damerau distance (optimal string alignment) also counts swapping two adjacent characters ("form" ↔ "from") as one edit, but never edits the same part twice, so "ca" → "abc" is 3, not 2.
Jaro–Winkler similarity counts the characters both strings have in nearly the same place, and scores a shared start higher, so it suits names.
Dice similarity is twice the pairs of neighbouring characters the strings share ÷ all their pairs. A moved word costs it little, so it suits longer text.
Hamming distance counts the places where the characters differ, so it only compares strings of the same length.
Edit distance and a similarity percent
String Similarity compares two pieces of text and reports its scores live as you type. The first is the Levenshtein distance: the minimum number of single-character insertions, deletions, or substitutions needed to turn one string into the other. The second is a similarity percentage, computed as 1 - distance / max(length), so identical strings score 100% and two completely different strings of the same length score 0%. Under the percentage, the Similarity box shows its own working with your numbers: 1 − 3 ÷ 7 = 57.1% for kitten and sitting. It works on any text — names, product SKUs, code snippets, or full sentences.
How the distance is calculated
The tool uses the classic dynamic-programming Levenshtein algorithm, which considers every possible edit path and returns the cheapest one. Because it counts substitutions as a single edit, changing "cat" to "bat" costs 1, while turning "kitten" into "sitting" costs 3. Alongside it the tool shows the Damerau distance, which additionally counts a swap of two adjacent characters (like "form" and "from") as a single edit — closer to how real typos happen. It is the optimal-string-alignment form, which never edits the same part twice, so ca to abc is 3 rather than 2. The comparison is case-sensitive and Unicode code points are treated as individual characters. Both values recalculate the instant either box changes, so you can experiment with spellings, typo corrections, or fuzzy matches without pressing a button. When you compare a pair, ⇄ Swap the two strings trades the boxes, and Show the edit-distance table draws the whole Levenshtein table — the first string down the side, the second across the top, both from an empty start (∅) — with the distance highlighted in its last cell; for strings too long to follow cell by cell, the page says so instead. Under the Similarity score, a bar as long as the score runs from red for nothing alike to green for identical, and Copy link hands the comparison over: the two strings, or the list, travel only in the link it copies and are not written into the address bar, while the mode is kept in the page address.
More scores, and the edits themselves
Beside the edit distances sit other measures. Jaro–Winkler similarity counts the characters both strings have in nearly the same place and gives extra weight to a shared start, which suits names. Dice similarity compares the pairs of neighbouring characters in each string, twice the shared pairs divided by all the pairs, so a moved word costs it little. Hamming distance counts the positions where the characters differ; it is defined only for two strings of the same length, and for any other pair the box says so instead of showing a number. Under the scores, the tool counts the substitutions, insertions and deletions along one shortest edit path and marks them in the text: a substitution as old→new, an insertion underlined, a deletion struck through.
Frequently asked questions
What exactly is Levenshtein distance?
It is the smallest number of single-character edits — insertions, deletions, or substitutions — required to change one string into another. For example, "kitten" to "sitting" is a distance of 3.
How is the similarity percentage calculated?
It is 1 minus the edit distance divided by the length of the longer string, shown as a percentage. Identical strings are 100%, and two equally long strings with no characters in common are 0%. Two empty strings count as 100% identical.
Can I find the closest match in a list?
Yes. Switch to “One against a list”, type the string to look up and paste the candidates one per line: every candidate is ranked by similarity, with its Levenshtein and Damerau distances beside it.
Can I see how the distance was worked out?
Yes. Tick “Show the edit-distance table” and the page draws the dynamic-programming table the distance comes from: each cell is the fewest edits that turn the first string up to that row into the second string up to that column, and the last cell, highlighted, is the Levenshtein distance. The table is drawn for short strings only; past the limit a line says how long each string may be.
Can I share a comparison, or see the score at a glance?
Yes. Copy link copies a link that reopens the comparison: the two strings, or the list, go after the # and the mode after the ?, and when the link is opened they are read back and taken out of the address. As you type, the strings are not written into the address bar, only into the link. Under the Similarity score, a bar as long as the score is coloured from red at 0% through amber to green at 100%.
Which score should I use?
For typos and short codes, the Levenshtein or Damerau distance and the Similarity percentage. For names, Jaro–Winkler, which favours a shared start. For longer text, Dice, which a moved word barely changes. For codes of a fixed length, Hamming, which only compares strings of the same length.