Text tools
Levenshtein Distance Calculator
Calculate the edit distance between two strings locally in your browser.
Levenshtein distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other.
Measure how different two strings are with the Levenshtein distance.
Enter two strings to see the minimum number of single-character edits (insertions, deletions, or substitutions) needed to change one into the other. The result includes the distance, a similarity percentage, and both string lengths. Everything runs locally in your browser, so your strings are not uploaded or stored.
Frequently Asked Questions
Everything you need to know about this tool, how it works, and privacy.
What is Levenshtein distance?
Levenshtein distance is the minimum number of single-character edits (insertions, deletions, or substitutions) required to change one string into the other. It measures how different two strings are.
How is the similarity percentage calculated?
Similarity is calculated as (1 - distance / max(length of string 1, length of string 2)) × 100. Identical strings have 100% similarity, completely different strings of equal length approach 0%.
What edits count toward the distance?
Three operations: inserting a character, deleting a character, or substituting one character for another. Each operation adds 1 to the distance.
Is my text private?
Yes. The calculation and copy action run locally in your browser. CodeASystem does not upload or store the strings you enter.