Skip to content
Tools

String Similarity Checker

Compare two strings: edit distance, similarity percentage and more.

Local

What this tool does

This tool measures how similar two strings are. It reports the edit distance, a similarity percentage, the Dice coefficient and, for equal-length strings, the Hamming distance.

The measures

  • Levenshtein distance: the number of single-character insertions, deletions or substitutions to turn one string into the other.
  • Similarity: that distance expressed as a percentage of the longer string, where 100% means identical.
  • Dice coefficient: overlap of two-character sequences, which is forgiving of word order and length differences.
  • Hamming distance: the count of differing positions, defined only when both strings are the same length.

Why testers reach for it

Sometimes an assertion should not be exact. When comparing generated text, OCR output or a value that varies slightly between runs, a similarity threshold is more robust than strict equality. This tool lets you see the numbers and choose a sensible threshold.

Common use cases

  • Choosing a fuzzy-match threshold for a flaky text assertion.
  • Quantifying how far an actual result drifted from the expected one.
  • Spotting near-duplicate strings in test data.

Frequently asked questions

When should I use fuzzy matching?
When an exact assertion is too brittle, for example comparing generated text or OCR output. Use the similarity percentage to pick a threshold.
What is the Hamming distance?
The number of positions at which two equal-length strings differ. It is not defined for strings of different lengths.

Learning resources

Testsmith also runs hands-on courses and a free practice app for the skills behind this tool.

Feedback welcome

Found a bug in this tool, or want it to do something it does not? Tell us and we will take a look.