The Fletcher-32 checksum extends Fletcher-16 to a 32-bit result by working on 16-bit words and reducing its two running sums modulo 65535. The wider accumulator detects larger and more complex burst errors while remaining inexpensive. This calculator runs the standard algorithm locally over text or hex bytes.
How it works
Fletcher-32 keeps two running sums, both reduced modulo 65535:
- Start with
sum1 = 0andsum2 = 0. - Read the data two bytes at a time into a 16-bit word
w = (high << 8) | low. - For each word: set
sum1 = (sum1 + w) mod 65535, thensum2 = (sum2 + sum1) mod 65535. - The final checksum is
(sum2 << 16) | sum1.
If the data has an odd number of bytes, the last byte is padded with a zero high byte so it still forms one complete word.
Why Fletcher works at all — the two-sum design
A naive single-sum checksum (simply add all bytes modulo N) fails silently when two bytes are transposed, because addition is commutative and their total is unchanged. Fletcher solves this with a second running sum that accumulates the first sum after every word. The second sum is effectively a weighted accumulator: early words contribute more to sum2 than late ones, because their value has been added to sum2 more times. This position-sensitivity means that swapping any two distinct words changes sum2 even when it leaves sum1 unchanged.
The modulus 65535 (a prime minus one, specifically 2^16 − 1) is chosen for the same reason Adler-32 uses 65521: prime moduli spread values more uniformly. Using 65536 (a power of two) would lose one bit of information on the carry and weaken the error-detection.
Fletcher-16 vs. Fletcher-32 vs. Adler-32
| Algorithm | Word size | Modulus | Output | Relative speed |
|---|---|---|---|---|
| Fletcher-16 | 8-bit bytes | 255 | 16 bits | Fastest |
| Fletcher-32 | 16-bit words | 65535 | 32 bits | Fast |
| Adler-32 | 8-bit bytes | 65521 (prime) | 32 bits | Fast |
| CRC-32 | 8-bit bytes | Polynomial GF(2) | 32 bits | Moderate (table) |
Fletcher-32 catches more burst errors than Fletcher-16 because operating on 16-bit words means a single-bit flip always changes one of the two 16-bit word values, and the 32-bit output space is wider. Adler-32 is slightly faster on byte-oriented architectures because it avoids the byte-pair assembly step. CRC-32 has the strongest error detection of the four but requires a precomputed table and more computation per byte.
Where Fletcher checksums appear
Fletcher-16 is used in OSI network layer protocols and some embedded systems. Fletcher-32 appears in some file formats and protocol specifications that need a quick 32-bit check without the complexity of a CRC table. Neither variant is a cryptographic primitive — an attacker can trivially craft data with any desired Fletcher checksum.
Example
For the ASCII string abcde the algorithm produces the checksum 0xF04FC729. Enter it in the tool to confirm the same hex and decimal output.
Notes
The modulus 65535 (2^16 - 1) plays the same role as 255 does in Fletcher-16: it keeps the sums position-sensitive so byte and word swaps are detected. Fletcher-32 is a data-integrity check only and does not defend against intentional tampering. All computation runs in your browser.