Hamming Distance Calculator
Work out hamming distance instantly with clear inputs, formula shown and shareable results.
About Hamming Distance Calculator
The Hamming distance counts positions where two equal-length strings differ. A code whose minimum distance is d can detect d − 1 errors and correct ⌊(d − 1)/2⌋ of them.
Formulas
Hamming distance
d(a, b) = number of positions where the symbols differ
Error capability
detect d − 1, correct ⌊(d − 1)/2⌋
Worked example
With the default values below, Hamming Distance Calculator returns Hamming distance of 2. Change any input above and every figure here is recalculated in your browser.
Inputs used
- First bit string
- 1011101
- Second bit string
- 1001001
Results
- Hamming distance
- 2
- Compared length
- 7
- Errors a code with this minimum distance detects
- 1
- Errors it can correct
- 0
Step by step
- 1Values used
- 2Hamming distance
- 3Error capability
- 4Hamming distance= 2
- 5Compared length= 7
- 6Errors a code with this minimum distance detects= 1
- 7Errors it can correct= 0
Assumptions and limits
- The result is derived only from the 2 inputs listed above. Anything not among them is not part of the calculation.
- In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
- Figures are rounded for display to whole numbers, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.
How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.
Frequently Asked Questions
Distance between 1011101 and 1001001?
Two positions differ, so the distance is 2.
How does distance relate to correction?
Codewords must be far enough apart that a corrupted word is still nearest to the original, which needs a gap of 2t + 1 to correct t errors.
Related Calculators
You might also need
- Discrete Logarithm CalculatorAlso in Discrete Math, Logic & Number Theory
- Adjacency Matrix CalculatorAlso in Discrete Math, Logic & Number Theory
- Base 64 Value CalculatorAlso in Discrete Math, Logic & Number Theory
- Bell Number CalculatorAlso in Discrete Math, Logic & Number Theory
- Binary To Decimal CalculatorAlso in Discrete Math, Logic & Number Theory
- Binary To Hexadecimal CalculatorAlso in Discrete Math, Logic & Number Theory
