Hamming Distance

Position-wise mismatches and percent identity for two equal-length sequences.

The Hamming Distance Calculator computes the number of position-wise mismatching characters between two equal-length DNA, RNA, or Protein sequences to quantify point mutational divergence and sequence identity.

Free, runs in your browser. Nothing you enter is uploaded.

How to use it

  1. Input Sequence 1 and Sequence 2 of identical character length.
  2. Calculate mismatch count (Hamming distance) and percent identity.

What you enter

What you get

Formula

d_H(s1, s2) = Σ [s1[i] ≠ s2[i]] | Percent Identity = [1 - (d_H / Length)] * 100

Evaluates character equality at each index 'i' from 0 to N-1 for two equal-length strings. Returns the total count of non-identical positions and computes relative percent identity.

Example: 100-bp Amplicon Variant Comparison

Input: Seq 1: 100 bp WT DNA | Seq 2: 100 bp Variant DNA (contains 4 point mutations)

Result: Hamming Distance: 4 mismatches | Percent Identity: 96.00% | Mismatch Positions: 14, 38, 72, 89

A distance of 4 indicates a 4% mutational divergence, characteristic of closely related viral isolates or clonal sublineages.

Questions

What is Hamming distance?

Hamming distance is the number of positions at which two equal-length sequences have different characters, representing substitution mutations.

Limitations

References

Related reading

All free tools · By Dr. Zubair Khalid, DVM, MS, PhD.