Calculation result
Detailed comparison
Processed sequences
Aligned transformation
Step-by-step operations
Optimal path summary
Dynamic-programming matrix
Large matrices are limited to 120 tokens per sequence for browser safety.
Batch matching and duplicate detection
Calculation history
History stays in this browser using local storage.
| Time | Source | Target | Distance | Similarity |
|---|
Formula used
Levenshtein distance finds the cheapest edit sequence. It allows insertion, deletion, and substitution operations. Optional transposition adds Damerau-style adjacent swaps.
D(i, 0) = i × deletion cost D(0, j) = j × insertion cost D(i, j) = min( D(i - 1, j) + deletion cost, D(i, j - 1) + insertion cost, D(i - 1, j - 1) + substitution cost ) Normalised distance = distance ÷ selected length denominator Similarity (%) = max(0, 1 - normalised distance) × 100
How to use
- Enter source and target text sequences.
- Select character, word, or token comparison.
- Adjust preprocessing and operation cost settings.
- Set similarity and distance acceptance thresholds.
- Select Calculate distance to inspect every result.
- Use batch mode to rank many candidate strings.
- Export results using CSV, PDF, copy, or print.
Example data
| Source | Target | Standard distance | Typical use |
|---|---|---|---|
| kitten | sitting | 3 | Classic edit-distance example |
| flaw | lawn | 2 | Spell-check comparison |
| machine learning | machine-learning | 1 | Text normalisation testing |
| colour | color | 1 | Regional spelling matching |
Machine learning applications
Use distance for entity resolution and fuzzy matching. It also supports OCR and speech evaluation. Search systems can rank near-duplicate text candidates.
Data teams can detect spelling variants quickly. Classification labels can be checked for drift. Cleaning pipelines gain transparent, reproducible matching rules.
Frequently asked questions
What does Levenshtein distance measure?
It measures the minimum edit cost between sequences. Standard edits are insertions, deletions, and substitutions. Smaller values indicate more similar sequences.
Is zero distance always an exact match?
Zero means the processed sequences are identical. Preprocessing can remove case, spaces, or punctuation. Review enabled options before interpreting exact matches.
How is similarity percentage calculated?
The distance is divided by a selected length. That normalised value is subtracted from one. The calculator then converts it into percentage form.
What are weighted edit costs?
Weighted costs value some edits differently. They model domain-specific correction or matching behaviour. Zero costs should be used very carefully.
What does transposition support change?
Transposition treats adjacent swaps as one operation. This follows a restricted Damerau-Levenshtein calculation. It helps analyse common typing mistakes.
Can this compare entire sentences?
Yes, character and word modes support sentences. Token mode uses whitespace-separated sequence elements. Large matrices may be hidden for performance.
How should thresholds be selected?
Choose thresholds from validated examples in your domain. Names often need stricter settings than noisy OCR. Test false matches before production use.
Can batch results detect duplicates?
Yes, low-distance or high-similarity rows are highlighted. Pairwise mode compares every candidate combination. Exported reports support further review.
Does the calculator support Unicode?
Modern browsers split Unicode characters safely with Array.from. Punctuation filtering also uses Unicode character classes. Complex grapheme clusters may still vary.