← All Tools

Hamming Distance Calculator

The Hamming distance counts the number of positions at which two equal-length sequences differ. It's foundational to error-detecting codes, DNA similarity, and hashing — but unlike Levenshtein, it requires both inputs to be the same length.

Mode:
length 0 Hamming distance 0 similarity 0% Levenshtein (for ref) 0

Position Diff

About Hamming Distance

Introduced by Richard Hamming in 1950, this metric counts mismatched positions between two equal-length sequences. For binary data it equals the number of 1-bits in A XOR B. A code that corrects t errors must have a minimum Hamming distance of at least 2t + 1. Unlike Levenshtein, it doesn't account for insertions or deletions — only substitutions — which is why both strings must have the same length.