Hamming Distance Calculator
Calculate the Hamming distance between two equal-length strings.
Count the positions where two strings of equal length differ: the Hamming distance. Compare by characters (karolin and kathrin differ in 3 places) or by binary bits, where each character is turned into bits first. You also see the length and the number of matching positions. Hamming distance is used in error-correcting codes, DNA comparison and checking how many bits changed.
Common use cases
- Learn error detection and correction in computer science
- Compare two DNA or protein sequences of the same length
- Count changed bits between two values
How to use
- Choose characters or binary bits.
- Enter two strings of the same length.
- Read the distance and matching positions.
FAQ
What if the strings are different lengths?
Hamming distance is only defined for equal lengths. For different lengths, use edit distance in the string similarity checker.
Where is it used?
In error-correcting codes such as Hamming codes, in genetics, and in comparing hashes and fingerprints.
Related tools
- String Similarity CheckerCalculate similarity percentage between two text strings.
- Text Diff CheckerCompare two texts and highlight differences between them.
- Character CounterCount total characters, letters, digits, and spaces in your text.
- Word ScramblerScramble letters within words for puzzles and games.
- Emoji CounterCount and list all emoji characters in your text.
- Anagram GeneratorGenerate anagram permutations from input words.