By Debmedia Technologies LLP · Kolkata, India · Updated
What Is It and When Do You Need It?
String distance tells you how close two words are. It is used in spell checkers, search, duplicate detection and DNA comparison.
Type two strings and read all the measures.
How to Use This Tool
- Enter or paste your input in the box or boxes above.
- Choose the options, if there are any.
- Press the button to run the tool.
- Read the result and use the copy button where one is shown.
How the Calculation Works
Levenshtein is worked out with dynamic programming on a table of prefixes. Hamming counts different positions. Jaro counts matching characters within half the length of the longer string and the transpositions between them. Jaro-Winkler adds a bonus of 0.1 per shared first letter up to four. The similarity percentage is 1 minus the Levenshtein distance divided by the longer length.
Worked Example
kitten and sitting have a Levenshtein distance of 3. martha and marhta have a Jaro-Winkler score of 0.9611.
Common Uses
- Finding typos and near duplicates.
- Matching names.
- Teaching algorithms.
- Comparing DNA strings.
Tips and Common Mistakes
- Convert both strings to the same case first if case should not matter.
- Long strings are limited to 5,000 characters.
- Spaces count as characters.
- Check the first result against a case you already know, so you can trust the tool for the rest.
- Nothing you type leaves your device. The work is done by your browser, so it also works with a slow connection once the page has loaded.
Related Tools
Next, you may need the text diff checker, Soundex generator, character counter, text repeater.
Everything runs in your browser. Nothing you type is uploaded, stored or sent to any outside service.
Frequently Asked Questions
Disclaimer: results are calculated in your browser from the numbers you enter. Check important results before you rely on them for money, health, safety or legal decisions.