Fletcher-16 is a position-sensitive checksum that uses two simple byte-sized running sums. It is far cheaper to compute than a CRC, which is why it shows up in low-power protocols and embedded firmware, while still catching the common single-bit and short burst errors. This tool computes it over the UTF-8 bytes of your text.
How it works
Two 8-bit accumulators, sum1 and sum2, are both reduced modulo 255:
sum1 = 0, sum2 = 0
for each byte b:
sum1 = (sum1 + b) mod 255
sum2 = (sum2 + sum1) mod 255
checksum = (sum2 << 8) | sum1
sum1 is a plain running total of the byte values. sum2 adds up every
intermediate sum1, which makes the result depend on the order of the bytes,
not just their values — so swapping two bytes changes the checksum. The two
sums are packed into a single 16-bit value with sum2 in the high byte.
Tips and notes
- The reference input
"abcde"yields0xC8F0— handy for confirming a port of the algorithm matches. - The mod-255 reduction is deliberate: a mod-256 (byte-wraparound) sum has well-known blind spots, and 255 avoids them.
- Fletcher-16 is for integrity only, not security; it is trivial to construct a different message with the same checksum.
- Larger relatives exist — Fletcher-32 (two 16-bit sums mod 65535) and Fletcher-64 — offering stronger detection at higher cost.