Fletcher-16 Checksum Calculator

Compute the Fletcher-16 error-detection checksum

Computes the Fletcher-16 checksum from text or hex bytes using the standard modulus-255 running sums. Shows sum1, sum2 and the packed 16-bit value for detecting single-bit and burst errors in data streams. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is the Fletcher-16 checksum?

Fletcher-16 is a position-dependent checksum that computes two running sums modulo 255 over a byte stream, then packs them into a 16-bit value. It detects all single-bit errors and most burst errors at very low cost.

The Fletcher-16 checksum is a lightweight error-detection algorithm devised by John G. Fletcher. It is far stronger than a plain modular byte sum because it is position-sensitive, yet it is cheap enough to run on small embedded devices. This calculator runs the exact algorithm in your browser over either UTF-8 text or raw hex bytes.

How it works

Fletcher-16 keeps two running sums, both reduced modulo 255:

  1. Start with sum1 = 0 and sum2 = 0.
  2. For each byte b: set sum1 = (sum1 + b) mod 255, then sum2 = (sum2 + sum1) mod 255.
  3. The final checksum is (sum2 << 8) | sum1sum2 is the high byte and sum1 is the low byte.

Because sum2 accumulates every intermediate value of sum1, the checksum depends on the position of each byte, not just the total. Swapping two bytes changes the result, which a simple additive sum would miss entirely.

Worked example

For the ASCII string abcde (bytes 97, 98, 99, 100, 101):

Byte 97:  sum1 = (0 + 97) mod 255 = 97   sum2 = (0 + 97) mod 255 = 97
Byte 98:  sum1 = (97 + 98) mod 255 = 195  sum2 = (97 + 195) mod 255 = 37
Byte 99:  sum1 = (195 + 99) mod 255 = 39  sum2 = (37 + 39) mod 255 = 76
Byte 100: sum1 = (39 + 100) mod 255 = 139 sum2 = (76 + 139) mod 255 = 215
Byte 101: sum1 = (139 + 101) mod 255 = 240 sum2 = (215 + 240) mod 255 = 200

Final checksum: (200 << 8) | 240 = 0xC8F0

Try abcde in the calculator and you will see 0xC8F0 — a quick sanity check for any implementation.

Fletcher-16 versus other lightweight checksums

Fletcher-16 occupies a useful middle ground between a simple sum and a full CRC:

ChecksumBitsPosition-sensitiveDetects transpositionsRelative cost
Simple modular sum8NoNoLowest
Fletcher-1616YesYesLow
Adler-3232YesYesLow
CRC-1616YesYesLow-medium

Fletcher-16 was originally designed for IP header checksums (RFC 905/1145) and is still used in some network protocols and embedded systems because it requires no lookup tables and runs efficiently on 8-bit microcontrollers. Fletcher-32 and Fletcher-64 scale the same approach to wider outputs for larger data.

The key advantage over a plain sum is the double-sum structure: a simple additive checksum cannot detect a swap of two bytes (because the sum is commutative), whereas Fletcher-16 will catch it. The modulus 255 rather than 256 is intentional — it avoids the all-zeros lock-in problem where a block of zeros would leave the running total unchanged.

Limitations

Fletcher-16 is an error-detection checksum, not a cryptographic hash. A motivated attacker can trivially construct a different message with the same Fletcher-16 value, so it offers no security properties. For integrity against deliberate tampering, use HMAC-SHA256 or a similar construction. For pure error-detection in constrained environments, Fletcher-16 remains a practical and reliable choice.

Everything here is computed locally in your browser — your data never leaves the device.