Levenshtein distance explained
Levenshtein distance is the minimum number of single-character insertions, deletions, and replacements needed to change one string into another. With the default unit costs, levenshtein('kitten', 'sitting') iimbuyekezo 3.
Browser result versus PHP
This page uses a client-side dynamic-programming implementation with a cost of one for insert, delete, and replace operations. It does not expose PHP's optional custom operation costs and does not run a PHP interpreter. Unicode handling can also differ because browser strings and PHP strings do not necessarily count characters the same way.
- Umgama
0 means the compared strings are identical under this calculation. - Longer strings naturally allow larger distances, so compare the reported percentage or normalize results when ranking candidates.
- Sebenzisa i PHP levenshtein() manual and a real PHP runtime for exact production compatibility.
The calculation runs locally and updates after input changes.