Levenshtein Distance Calculator
Free online Levenshtein distance calculator. Measure the edit distance and similarity ratio between two strings instantly. See substitution, insertion, and deletion counts, character alignment, and the full DP matrix. 100% client-side.
Loading tool...
What is Levenshtein Distance Calculator?
The Levenshtein Distance Calculator is a free, client-side tool that measures how similar two pieces of text are. It reports the minimum number of single-character edits (insertions, deletions, and substitutions) needed to turn one string into the other, along with a similarity percentage, a Hamming distance when lengths match, an operation breakdown, a character alignment, and the full dynamic-programming matrix.
Key Benefits
- See Levenshtein distance and a 0β100% similarity ratio update live as you type
- Understand the difference with matches, substitutions, insertions, and deletions counted separately
- Visualize the edit path with a color-coded character alignment and shaded DP matrix
- Handle messy real-world data with case-insensitive and whitespace-normalization options
- Keep data private β everything runs locally in the browser with no server calls
Common Use Cases
- β’Build fuzzy matching, autocomplete, or spell-checking features during development
- β’Find near-duplicate product names, addresses, or user records for data cleaning
- β’Teach or learn the classic Levenshtein dynamic-programming algorithm visually
- β’Compare log messages, error strings, or command output to cluster similar entries
- β’QA string transformations to verify that output stays within an expected edit distance
How to Use the Levenshtein Distance Calculator
- Enter both strings: Type or paste your two strings into the String A and String B boxes. Results update live as you type.
- Choose options: Optionally enable Case insensitive or Ignore extra whitespace to match how real-world text is compared.
- Read the results: Check the Levenshtein distance, similarity percentage, Hamming distance, and the counts of matches, substitutions, insertions, and deletions.
- Inspect alignment & matrix: Review the color-coded character alignment and, for short strings, the shaded DP matrix. Click Copy to save the summary or Swap to reverse the inputs.
Key Features
- Instant Levenshtein (edit) distance and a 0β100% similarity ratio between any two strings, computed live as you type
- Operation breakdown showing matches, substitutions, insertions, and deletions so you see exactly what changed
- Color-coded character alignment that maps each position from String A to String B, with gaps marked clearly
- Interactive dynamic-programming matrix with shaded cells, rendered automatically for short strings
- Case-insensitive and whitespace-normalization toggles for comparing real-world, messy text
- 100% client-side and offline β no server calls, no tracking, and Hamming distance included when lengths match