Measure string similarity with Levenshtein distance

Quantify how alike two strings are — for fuzzy matching, typo detection, and deduplication.

By The DevFixPro Editorial Team · independent editorial research project

Private by design. Every tool linked below runs 100% in your browser — your code, text, and tokens never leave your device.

Are these two strings the same record?

"Jonn Smith" and "John Smith" look like the same person, but an exact match misses them. When you are merging lists or catching typos, you need a number that says how close two strings are, not just yes or no.

Compute the distance

The String Similarity tool calculates the Levenshtein distance — the count of single-character edits needed to turn one string into the other — and a normalized similarity ratio. Set a threshold and you can flag near-duplicates automatically.

See the actual edits

A distance number tells you how different two strings are; the Text Diff Viewer shows you where. Paste the two values side by side to see exactly which characters differ, which is far easier to judge than a raw score.

Where it pays off

  • Deduplicating names or addresses across merged datasets.
  • Catching likely typos before a send or an import.
  • Ranking fuzzy search results by closeness.

Frequently Asked Questions

What does the distance number actually mean?

It is the minimum number of single character edits that turn one string into the other. A distance of one on a short value is a typo; the same number on a long value is a very close match.

What similarity threshold should I use?

Base it on the mistake you expect. Pick the distance a realistic typo would produce at that length, treat anything at or below it as a candidate, and route the matches to review rather than merging them automatically.

Why does the same pair score differently on short and long strings?

Because a raw distance is absolute while the meaning depends on length. Normalising into a score between zero and one makes short and long comparisons rankable, which is why both measures are worth seeing together.

← All guides

Related tools from our network

A focused set of free calculators and guides across related topics — no account required.