String Similarity
Compare two strings and calculate Levenshtein distance and similarity percentage.
Report a Problem
Found a bug or have a suggestion? Help us improve this tool.
What is this tool?
String similarity calculator compares two text strings using the Levenshtein distance (edit distance) algorithm. It counts the minimum number of single-character edits (insertions, deletions, substitutions) needed to transform one string into the other, converts that into a 0-100% similarity score, and lists the exact edit operations. Useful for fuzzy matching, typo detection, spell checking, and data deduplication.
How to use
- 1
Enter first string
Input the first text to compare.
- 2
Enter second string
Input the second text to compare.
- 3
View results
See the Levenshtein distance, the 0-100% similarity score and the list of edit operations.
Frequently Asked Questions
What is Levenshtein distance?
Levenshtein distance counts the minimum number of single-character edits (insertions, deletions, substitutions) needed to transform one string into another. Distance of 0 means identical strings. Lower distance = more similar.
How is the similarity score calculated?
The tool computes the Levenshtein distance D between the two strings, then shows similarity as (longest string length - D) / longest string length x 100. Identical strings score 100%. The score is 0% when D equals the length of the longer string (for example "ab" vs "ba"). Two empty strings also score 100%.
Can I process very large text?
Keep the two strings to a few hundred KB each in practice. The Levenshtein algorithm scales with the product of both lengths, so doubling both strings roughly quadruples the work. For longer documents, compare them in smaller chunks.
What does the result display?
The Levenshtein distance, the similarity percentage with a color indicator (green at 70% or higher, yellow between 40% and 70%, red below 40%), and the list of edit operations (insertions, deletions, substitutions) that transform the first string into the second. All computation happens in your browser; nothing is sent over the network.
Related tools
- Text CounterCount characters, words, sentences, paragraphs. Transform text case instantly.
- Word Frequency CounterCount word frequency in text. Case-insensitive analysis with punctuation removal.
- Diff CheckerCompare two texts line by line. See additions and removals instantly.
- Remove DuplicatesRemove duplicate lines from text while preserving original order.