PB
Available
code
lock Free · Private · In-Browser

Hamming Distance Calculator

Count the differing positions between two equal-length strings.

How far apart are two strings?

The Hamming distance counts how many positions two equal-length strings differ in — the number of substitutions needed to turn one into the other. It underpins error-detecting codes and sequence comparison.

The binary strings 1011101 and 1001001 differ in two positions, so their Hamming distance is 2. It works just as well on DNA bases or text, as long as the two strings are the same length.

Exact and private

The comparison runs in your browser, so nothing you enter is uploaded.

Frequently Asked Questions

What is Hamming distance?

The number of positions at which two equal-length strings differ. It measures how many single changes separate them.

What can I compare?

Any two strings of the same length — binary codes, DNA sequences, or plain text.

Why must lengths match?

Hamming distance is defined only for equal-length strings. For different lengths, an edit distance is the right measure.

Take it further
All Free Tools

Browse the full set of free, private, in-browser tools.

Learn More arrow_forward