About this tool
The Hamming Distance Calculator counts the positions at which two equal-length inputs differ — the core metric behind error-detecting and error-correcting codes. Both inputs must be the same length; if they are not, the tool shows a clear error with each length rather than guessing an alignment. It reports the raw distance, the normalized distance (distance ÷ length, from 0 to 1), the comparison length, the number of matching positions, and a per-position diff that highlights every mismatch in red.
Three modes cover the common cases. In text mode it compares the strings code point by code point, so equal length means the same number of characters. In binary mode it validates that each input contains only 0s and 1s of equal length and counts the differing bit positions — equivalently the popcount of their XOR. In hex mode it parses both inputs as hexadecimal of equal digit length, XORs them nibble by nibble, and sums the set bits, giving the true bit-level Hamming distance; the length here is the total number of bits (hex digits × 4).
The computation is pure, deterministic, and fully offline — nothing you enter leaves your browser. Hamming distance is used to measure how many single-bit errors separate two codewords, to compare fixed-length hashes or fingerprints, and in bioinformatics to compare equal-length sequences. Because it requires equal lengths, use edit distance instead when the strings can differ in length.