Canonical: https://toolipedia.app/string-similarity-and-edit-distance

# String Similarity and Edit Distance

Compare two texts and get the Levenshtein and Damerau distance, Hamming distance, Jaccard and cosine similarity, the longest common substring and a percentage match.

Breadcrumbs: Toolipedia > Text tools > Text tools > String Similarity and Edit Distance

## About String Similarity and Edit Distance

Compare two texts and get several measures at once. Levenshtein distance counts the fewest insertions, deletions and substitutions to turn one text into the other, for example 3 for kitten and sitting, which is 57.14% alike. Damerau-Levenshtein also counts a swap of two neighbours as one step. Hamming distance counts differing positions in equal-length texts. Jaccard and cosine similarity compare letter pairs, single letters or words. The page also gives the longest common substring and subsequence, and can compare words instead of characters.

## How to use String Similarity and Edit Distance
1. Paste the two texts into the first and second box.
2. Choose whether edit distance counts characters or words and which units Jaccard and cosine use.
3. Read the distances and percentages in the result grid.

## Why use this tool?
- Private: everything happens in your browser. Nothing you enter is uploaded.
- Free, with no sign-up, no watermark and no limit on how often you use it.
- Works on phones, tablets and computers: Android, iPhone, Windows, Mac and Linux. Nothing to install.
- Free to embed on your own website, with a ready-made code to copy.

## Also known as
- string similarity and edit distance
- levenshtein distance calculator
- compare two strings similarity
- hamming distance calculator
- jaccard cosine similarity text
- longest common substring

## Frequently asked questions

### What is a good similarity percentage?

It depends on the job. Near 90% usually means a typo or small edit, while below 50% means the texts are quite different. Test with examples from your own data before choosing a cut-off.

### Why is Hamming distance sometimes not shown?

It is only defined for two texts of the same length, because it counts positions that differ. For different lengths use Levenshtein distance, which allows insertions and deletions.

### How is cosine similarity different from Jaccard?

Jaccard looks only at which units appear, while cosine also uses how many times each appears. Repeated words push cosine up when both texts repeat the same words.

### Is String Similarity and Edit Distance free?

Yes. String Similarity and Edit Distance on Toolipedia is free to use, with no sign-up and no watermark.

### Is it safe to use?

Yes. Everything is worked out in your browser, and nothing you enter is sent to our server.

### Does it work on my phone?

Yes. It works in any modern browser on Android and iPhone, as well as on tablets and computers. There's nothing to install.

### Do I need an account?

No. Just open the page and use the tool. There's no sign-up and no email needed.

### Can I put String Similarity and Edit Distance on my own website?

Yes. Use the Embed on your site button under the tool to copy a short piece of code and paste it into your page. It is free, needs no account, and the tool keeps working inside your page.

## Related tools

More free tools that go well with String Similarity and Edit Distance:
- [Distance and Similarity Calculator](https://toolipedia.app/distance-and-similarity-calculator)
- [Longest Word Finder in Text](https://toolipedia.app/longest-word-finder)
- [Random string generator](https://toolipedia.app/random-string-generator)
- [Paraphrase Overlap Checker](https://toolipedia.app/paraphrase-overlap-checker)
- [Compression and Coding Demos](https://toolipedia.app/compression-and-coding-demos)
