String Similarity
Compare two strings with Levenshtein, Jaro-Winkler, Cosine, Jaccard, Hamming & Dice algorithms. Instant results, 100% private.
What is string similarity?
String similarity measures how closely two text strings match each other. It is used in spell checking, DNA analysis, plagiarism detection, and data deduplication.
What is Levenshtein distance?
Levenshtein distance (edit distance) measures the minimum number of single-character edits — insertions, deletions, or substitutions — needed to change one string into another. For example, the distance between "cat" and "bat" is 1.
What is Jaro-Winkler similarity?
Jaro-Winkler gives higher scores to strings that share a common prefix. It is widely used for matching names, addresses, and records in databases where typos are common.
How does Cosine similarity work?
Cosine similarity breaks strings into character n-grams, converts them into vectors, and measures the cosine of the angle between the vectors. It works well for longer texts and is commonly used in information retrieval.
What is the difference between Cosine and Jaccard similarity?
Cosine similarity uses n-gram frequency vectors and measures the angle between them, while Jaccard similarity compares sets of n-grams using the ratio of intersection to union. Jaccard ignores duplicates; Cosine does not.
What is Hamming distance?
Hamming distance counts the number of positions where corresponding characters differ between two equal-length strings. It only works on strings of the same length and is commonly used in error-correcting codes.
What is the Sørensen-Dice coefficient?
The Sørensen-Dice coefficient (also called Dice's coefficient) measures similarity based on the number of shared bigrams relative to the total bigrams in both strings. It gives more weight to common elements than Jaccard.
Which algorithm should I use?
For short strings with typos (names, codes), use Levenshtein or Jaro-Winkler. For longer texts, Cosine similarity works best. For quick set-based comparison, use Jaccard. For equal-length strings, Hamming is the simplest.
What is n-gram analysis?
An n-gram is a contiguous sequence of n characters from a string. For example, the bigrams of "hello" are "he", "el", "ll", "lo". N-grams are the building blocks of many similarity algorithms.
What is fuzzy matching?
Fuzzy matching finds strings that approximately match a pattern, rather than exactly. It is used in search engines, spell checkers, and data cleaning to handle typos and variations.
Is my data sent to a server?
No, all calculations are performed locally in your browser. Your text never leaves your device. There is no server-side processing or data storage.
Can I compare texts in different languages?
Yes, the algorithms work on any Unicode characters. However, results may vary because different languages have different character structures and word boundaries.