Are there any Fuzzy Search or String Similarity Functions libraries written for C#?

Levenshtein distance implementation:

  • Using LINQ (not really, see comments)
  • Not using LINQ

I have a .NET 1.1 project in which I use the latter. It's simplistic, but works perfectly for what I need. From what I remember it needed a bit of tweaking, but nothing that wasn't obvious.


you can also look at the very impressive library titled Sam's String Metrics https://github.com/StefH/SimMetrics.Net . this includes a host of algorithms.

  • Hamming distance
  • Levenshtein distance
  • Needleman-Wunch distance or Sellers Algorithm
  • Smith-Waterman distance
  • Gotoh Distance or Smith-Waterman-Gotoh distance
  • Block distance or L1 distance or City block distance
  • Monge Elkan distance
  • Jaro distance metric
  • Jaro Winkler
  • SoundEx distance metric
  • Matching Coefficient
  • Dice’s Coefficient
  • Jaccard Similarity or Jaccard Coefficient or Tanimoto coefficient
  • Overlap Coefficient
  • Euclidean distance or L2 distance
  • Cosine similarity
  • Variational distance
  • Hellinger distance or Bhattacharyya distance
  • Information Radius (Jensen-Shannon divergence)
  • Harmonic Mean
  • Skew divergence
  • Confusion Probability
  • Tau
  • Fellegi and Sunters (SFS) metric
  • TFIDF or TF/IDF
  • FastA
  • BlastP
  • Maximal matches
  • q-gram
  • Ukkonen Algorithms

They are not my own invention, but they are my favorites and I've just blogged about them and published my own tweaked versions of Dice Coefficient, Levenshtein Distance, Longest Common Subsequence and Double Metaphone in a blog post called Four Functions for Finding Fuzzy String Matches in C# Extensions.