1. Home
  2. Developer tools
  3. Adler-32 and Fletcher Calculator

Adler-32 and Fletcher Calculator

Two simple, fast checksum families used in zlib, PNG-related tools, network protocols and embedded systems. Enter data and see all four results.

Free, no sign-up. Runs in your browser: nothing is uploaded.

How to use Adler-32 and Fletcher Calculator

  1. Enter text or hex, or open a file.
  2. Read the four checksums.
  3. Compare with your system’s value.

Features

  • Adler-32 as used by zlib
  • Fletcher-16, Fletcher-32 and Fletcher-64
  • Hex and decimal output
  • Text, hex, Base64 or file input
  • Known test values in the guide
  • Runs in your browser

Supported formats

Input

  • Any file (read in your browser)
  • Text
  • Hex bytes

You get

  • Adler-32 and Fletcher checksums

Private by design

Everything you enter is processed by your browser on this device. Nothing is sent to openWorkstand or anyone else, so the Adler-32 and Fletcher Calculator is safe for private and work data. After you have used it once while online, it also works without an internet connection. How local processing works

Good to know

  • Adler-32 is weak for short messages and neither checksum protects against deliberate changes.
  • Fletcher implementations differ in word size and padding; this page uses little-endian words and zero padding.

Guide

Adler-32 and Fletcher checksums explained with a worked example

Two simple checksum families keep turning up in low-level code: Adler-32, defined by Mark Adler for the zlib compression library, and the Fletcher checksums, described by John G. Fletcher in 1982. Both are cheaper than a CRC and both rely on the same trick, two running sums. This page calculates Adler-32 and Fletcher-16, -32 and -64 for any data at once.

How Adler-32 works

The algorithm keeps two 16-bit values. A starts at 1 and gets each data byte added; B starts at 0 and gets A added after every byte. Both are reduced modulo 65521, the largest prime that fits in 16 bits. The final checksum puts B in the high half and A in the low half. Because A and B start small and grow by at most 255 per byte, a very short message leaves both sums far below the modulus, so few bits change between similar short inputs. That is the known weakness of Adler-32 on small messages.

A worked example

The Sample button loads the nine bytes of the word Wikipedia, the example used in the algorithm’s reference article. The page reports Adler-32 as 11e60398, in decimal 300286872. Working it out by hand: the nine byte values add up to 919, so A is 1 + 919 = 920, which is 0x0398. After each byte B adds the current A, and the nine running values 88, 193, 300, 405, 517, 618, 718, 823 and 920 add up to 4582, which is 0x11E6. Joined, B then A, they make 0x11E60398. The same data gives Fletcher-16 ee9a, Fletcher-32 b7dda1f8 and Fletcher-64 0f0b0748d2cfcf28 on this page, with a length of 9 bytes.

Fletcher differences

Fletcher uses the same two sums but takes a word at a time and reduces modulo one less than a power of two, so the sums are those of a one’s complement addition. Fletcher-16 works on bytes, Fletcher-32 on 16-bit words and Fletcher-64 on 32-bit words. Implementations disagree about the byte order of words and about padding. This page reads little-endian words and pads the last word with zeros. If a datasheet’s value does not match, test the other conventions by padding or reordering your input as hex.

Input and output

You can enter text, hex bytes or Base64, or open a file. Each result is shown in hexadecimal, and Adler-32 also in decimal, with a copy button. Text is converted to UTF-8 first, so non-ASCII characters add more than one byte each.

Limits

Neither family is a security tool; both are trivial to forge. Adler-32 is a poorer error detector than CRC-32 for short data, and Fletcher checksums do not detect some patterns of swapped blocks. The page calculates only the checksums listed and does not handle file format wrappers such as a complete zlib stream.

Choosing between the checksums

Pick Adler-32 when a format demands it, as zlib does, and when the data is long enough for the sums to spread, from a few hundred bytes upward. Pick a Fletcher variant when a protocol or datasheet names it, often in embedded firmware where the cost of a division matters. For anything else, a CRC detects more kinds of damage at similar cost, and a cryptographic hash is the only choice when someone might alter the data on purpose.

Checked against the current version of the Adler-32 and Fletcher Calculator on .

Frequently asked questions

Where is Adler-32 used?

It sits at the end of every zlib stream as an integrity check on the uncompressed data, and the rsync tool builds a rolling checksum on the same idea. PNG files use CRC-32 instead.

Why are all four results shown together?

They answer the same question for different systems. Showing them side by side lets you compare a value from a datasheet or a log with each of the common candidates in one step.

How is Adler-32 different from CRC-32?

Adler-32 is faster and simpler, but weaker on short messages, because its sums stay small. CRC-32 detects more kinds of error.

Why do Fletcher results differ between libraries?

Implementations disagree on word order (little or big endian) and on how to pad a short last word. This page reads little-endian words and pads with zero bytes.

Keep working with the result

openWorkstand also includes a free workspace with documents, spreadsheets, tasks, projects and a calendar that save to a folder on your computer.