UTILS.
Private by default
≈

Text Similarity

Compute Levenshtein edit distance and a similarity percentage.

Your files stay on this device

Files are processed in your browser, never uploaded. The site downloads code and assets to run the tools. No accounts or trackers.

Use Download to save this tool as one HTML file for offline use.

Privacy →

About this tool

Measure how different two strings are using the Levenshtein edit distance and a similarity score. The calculation runs in your browser.

Both texts are split into whole code points before comparing, so an emoji counts as one character. The comparison is case-sensitive, and spaces, punctuation and line breaks all count, so Kitten and kitten have a distance of 1. The page starts with kitten and sitting, which have a distance of 3.

Three values are shown: the distance, the similarity with one decimal, and the length of the longer text. Two empty inputs count as 100 percent similar. Only insertions, deletions and substitutions are counted, so swapping two neighbouring letters costs 2, not 1. The work grows with the product of the two lengths, so very long texts are slower.

Frequently asked questions

What is edit distance?
It is the minimum number of single-character insertions, deletions or substitutions needed to turn one string into the other.
How is similarity computed?
Similarity is 1 minus the distance divided by the longer string's length, shown as a percentage.
Is a lower distance always a better match?
The distance is an absolute count, so 3 edits means far more for two five-letter words than for two long paragraphs. The similarity percentage divides by the longer length, so use it to compare pairs of different sizes.
Does it ignore case or accents?
No. Comparison is exact, so uppercase against lowercase and accented against unaccented letters each count as a substitution. Lowercase both texts first if case should not matter.

More tools