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.
How to Use String Similarity
Compare two strings and score how alike they are with algorithms such as Levenshtein, Jaro-Winkler, Jaccard, and Dice, all computed locally in your browser.
- Paste the first string into the upper input box and the second string into the lower one.
- Watch the similarity scores update instantly as you edit either text, from 0 (no match) to 1 (identical).
- Read Levenshtein for the number of single-character edits between the strings and Jaro-Winkler for prefix-heavy comparisons like names.
- Use Jaccard or Dice to measure shared character sets, Cosine for vector-style overlap, and Hamming only for strings of equal length.
Algorithms disagree by design: check two or three side by side, since Levenshtein counts edits while Jaccard counts shared pieces.
Related Tools
- Line Sort Sort text lines alphabetically, numerically, or by length. Remove duplicates and reverse order with one click.
- Number Spell Out Convert numbers to English words, Chinese uppercase, Roman numerals, and scientific notation instantly.
- Case Converter Convert text between uppercase, lowercase, title case, camelCase, snake_case, kebab-case and more instantly
- Randomize Case Randomly convert text letters to uppercase or lowercase. Create SpongeBob case text instantly in your browser.
- Create Palindrome Create palindromes from any text by appending the reversed string. Free online tool that works instantly in your browser with multi-line support.
- Palindrome Checker Instantly check if any text, word, or sentence is a palindrome. Free online tool that runs 100% in your browser — no data sent to any server.
- String Rotate Rotate text characters left or right with circular shift. Free online tool, no installation needed.
- String Repeat Repeat text any number of times with a custom separator. Fast, free, and 100% browser-based.