๐Ÿ”ข Hamming Distance Calculator

3Hamming distance
karolin

Compares two equal-length strings (or bit strings) character by character and counts the positions where they differ โ€” the Hamming distance. It's a fundamental distance metric used in error-detecting code theory, comparing DNA sequences, and similarity scoring in machine learning.

How to use

  1. Enter the two strings you want to compare (they must be the same length).
  2. The Hamming distance is calculated automatically, and differing characters are highlighted in red.
  3. If the strings have different lengths, an error message is shown instead.

FAQ

What is Hamming distance?

When comparing two equal-length sequences (strings or bit strings), it's the total number of positions where the corresponding values differ.

What happens if the strings are different lengths?

Hamming distance is only defined between sequences of equal length, so mismatched lengths can't be calculated and show an error instead.

Where is this used?

It's widely used in error-detecting/correcting code theory, comparing mutation counts between DNA sequences, and similarity scoring for feature vectors in machine learning.