Work out hamming similarity instantly with clear inputs, formula shown and shareable results.
Hamming distance counts the positions at which two equal-length sequences differ, so similarity is one minus that count over the length. It underpins error-detecting codes, SimHash near-duplicate detection and locality-sensitive hashing over binary fingerprints, where a distance of a few bits out of 64 marks two documents as near-identical.
Hamming distance
d = number of positions where the sequences differ; similarity = (length - d) / length
Hamming distance is only defined for equal lengths. Length differences are counted as mismatches here, but for genuinely different lengths Levenshtein distance is the right measure.
SimHash and similar fingerprints map similar content to similar bit patterns, so a small Hamming distance between 64-bit signatures identifies near-duplicates in constant time.