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:
- Start with
sum1 = 0andsum2 = 0. - For each byte
b: setsum1 = (sum1 + b) mod 255, thensum2 = (sum2 + sum1) mod 255. - The final checksum is
(sum2 << 8) | sum1—sum2is the high byte andsum1is 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 sum would miss.
Example
For the ASCII string abcde (bytes 97 98 99 100 101) the running sums settle at sum1 = 240 and sum2 = 200, giving a checksum of 0xC8F0. Try it in the tool to see the same value.
Notes
The odd modulus 255 is deliberate — it prevents the running sums from ever locking into a value that would hide a byte swap. Fletcher-16 is an integrity check only and offers no protection against deliberate tampering. Everything here is computed locally; your data never leaves the browser.