Free Online Tool

Hamming Distance

Calculate Hamming distance between strings.

How to Use Hamming Distance

  1. Enter two strings (or two binary/hex values) of equal length.
  2. The tool counts the positions where the two differ β€” that count is the Hamming distance.
  3. For binary inputs it also shows the XOR, whose number of 1 bits equals the distance.
  4. Copy the result. Everything is computed in your browser.

Hamming distance measures how many single-character (or single-bit) substitutions turn one string into the other. It underpins error-detecting and error-correcting codes.

Examples

Two words β€” input:

karolin vs kathrin

Output:

3

Positions 3, 5, and 6 differ (r/t, o/h, l/r).

Binary strings β€” input:

1011101 vs 1001001

Output:

2

The two strings differ in two bit positions.

Identical inputs β€” input:

cat vs cat

Output:

0

A distance of 0 means the inputs are identical.

Features

Privacy Focused

All processing happens in your browser. No data is sent to servers.

Free Forever

No registration, no limits, completely free to use.