Formula used
Standard Jaccard compares unique token sets. It divides shared tokens by all distinct tokens.
J(A, B) = |A ∩ B| / |A ∪ B| Jaccard distance = 1 - J(A, B) Multiset Jaccard = Σ min(fA, fB) / Σ max(fA, fB) Weighted Jaccard = Σ wᵢ min(xᵢ, yᵢ) / Σ wᵢ max(xᵢ, yᵢ)
How to use this calculator
- Enter two texts in the main input fields.
- Select a token level and similarity method.
- Choose preprocessing rules for your comparison goal.
- Add custom weights or batch texts when needed.
- Submit the form and review every result section.
- Copy, print, or download the calculated report.
Example data
| Text A | Text B | Expected behavior |
|---|---|---|
| machine learning model | machine learning algorithm | Two shared tokens create moderate similarity. |
| cat dog bird | cat dog bird | Identical sets produce a score of one. |
| red green blue | circle square triangle | No shared tokens produce zero similarity. |
| data data model | data model model | Multiset scoring reflects repeated token counts. |
Jaccard similarity in machine learning
Jaccard similarity measures overlap between two token collections. It works well for sparse binary features.
Common uses include duplicate detection, search, clustering, and record linkage. Preprocessing choices strongly affect each score.
Cosine similarity considers vector direction and term frequency. Dice similarity doubles the shared-set contribution.
Jaccard ignores word order unless n-grams preserve local sequences. It also misses semantic similarity between synonyms.
Frequently asked questions
What does a Jaccard score mean?
A score near one indicates strong token overlap. A score near zero indicates little overlap.
Is Jaccard similarity case-sensitive?
It can be case-sensitive when that option remains enabled. Lowercasing usually improves ordinary text comparisons.
Should stop words be removed?
Remove them when common words add little meaning. Keep them when phrasing patterns matter.
What is multiset Jaccard?
Multiset Jaccard includes repeated token frequencies. Standard Jaccard uses only unique token presence.
How does weighted Jaccard work?
Weighted Jaccard gives selected tokens more influence. Enter each custom token weight separately.
Why use word n-grams?
Word n-grams preserve short phrase order. They reduce matches caused by isolated shared words.
Why use character n-grams?
Character n-grams tolerate spelling changes and morphology. They help compare noisy short strings.
Can Jaccard detect paraphrases?
Basic Jaccard may miss paraphrases using different words. Semantic embeddings are better for meaning.
What happens when both texts are empty?
The calculator reports a validation warning. An empty union cannot support meaningful similarity.