Fletcher-16 Checksum Calculator

Compute the Fletcher-16 two-byte checksum for data integrity

Calculate the Fletcher-16 modular-sum checksum of any text over its UTF-8 bytes. Returns the 4-digit hex value, decimal form, and the two component sums, all computed locally in your browser using the classic two-sums-mod-255 algorithm. It runs free in your browser on Gera Tools, with nothing uploaded.

Last updated Source: Gera Tools

What is Fletcher-16 used for?

Fletcher-16 is a lightweight checksum used in protocols and embedded systems where a full CRC is too costly. It catches most single-bit and burst errors with just two byte-sized running sums, making it cheap on small microcontrollers.

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" yields 0xC8F0 — 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.

Fletcher-16 versus other checksums

Choosing the right checksum depends on the cost budget and error-detection requirements:

ChecksumWidthDetects burst errorsDetects reorderingCost
Simple sum8–32 bitNo (only single-bit)NoMinimal
Fletcher-1616 bitYes (short bursts)YesVery low
Fletcher-3232 bitYes (longer bursts)YesLow
Adler-3232 bitSimilar to Fletcher-32YesLow
CRC-1616 bitYes (polynomial-based)YesLow–medium
CRC-3232 bitStrong burst detectionYesMedium
SHA-256256 bitDesigned for securityYesHigh

Fletcher-16 sits between the trivially weak simple sum and the heavier CRC in both cost and detection capability. The key advantage over a simple sum is that sum2’s position-dependence catches byte swaps and reorderings — failures that a plain sum-of-bytes misses entirely.

Where Fletcher-16 appears in real protocols

Several embedded systems and network protocols have used Fletcher-style checksums:

  • IS-IS (Intermediate System to Intermediate System): the link-state routing protocol used in large ISP networks uses a Fletcher checksum in its PDU headers
  • OSPF: also uses a Fletcher checksum for Link State Advertisement (LSA) integrity
  • DNP3: a protocol used in industrial control systems and power grid SCADA uses Fletcher-16 for data link layer integrity
  • Bootloader protocols: many microcontroller bootloaders use Fletcher-16 because it can be implemented in roughly a dozen lines of C without a lookup table, important when flash and RAM are measured in kilobytes

The mod-255 algorithm requires only addition and modular reduction — no multiplication, no table lookup, and it can run on an 8-bit processor in a tight loop, which is exactly what makes it appealing for small embedded targets.

Verifying an implementation

Three well-known test vectors are useful for checking a port of the algorithm:

InputExpected Fletcher-16 (hex)
abcde0xC8F0
abcdef0x2057
abcdefgh0x0627

If your implementation produces all three correctly, it is almost certainly right. If it produces the correct sum1 but wrong sum2, the most common cause is applying the modulo to the final value instead of (or in addition to) applying it after each byte.