🧰 UtlKit

String Similarity

Compare two strings and calculate Levenshtein distance and similarity percentage.

Distance
3
Similarity
57.1%
Operations
7
Similarity
Edit Operations (7)
1. Replace 'k' → 's'
2. Match 'i'
3. Match 't'
4. Match 't'
5. Replace 'e' → 'i'
6. Match 'n'
7. Insert 'g'
🐛

Report a Problem

Found a bug or have a suggestion? Help us improve this tool.

📊 Data Summary (auto-filled)

Tool: string-similarity · /tools/string-similarity/

str1: kitten

str2: sitting

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. 1

    Enter first string

    Input the first text to compare.

  2. 2

    Enter second string

    Input the second text to compare.

  3. 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.