How to use the adler-32 calculator
- Enter your data in the Input field as plain text or a hexadecimal string.
- Select Text (UTF-8) or Hexadecimal from the format dropdown.
- Read the resulting Adler-32 checksum displayed as an 8-character hexadecimal value.
- Check the S1 and S2 rows to see the two 16-bit halves that make up the final hash.
How the Adler-32 algorithm works
The Adler-32 checksum is defined in RFC 1950 and uses two 16-bit accumulators, S1 and S2. S1 starts at 1 and S2 starts at 0. For every byte in the input, the algorithm adds the byte value to S1, then adds the new S1 to S2. Both values are reduced modulo 65521, the largest prime smaller than 216.
Consider the string "Wiki". The ASCII values are W=87, i=105, k=107, i=105.
- Byte 87: S1 = 1 + 87 = 88, S2 = 0 + 88 = 88
- Byte 105: S1 = 88 + 105 = 193, S2 = 88 + 193 = 281
- Byte 107: S1 = 193 + 107 = 300, S2 = 281 + 300 = 581
- Byte 105: S1 = 300 + 105 = 405, S2 = 581 + 405 = 986
The final checksum is (S2 * 65536) + S1, which gives 986 * 65536 + 405 = 64618901. In hexadecimal that is 03DA0195. Using this adler32 calculator lets you skip the manual arithmetic.
Reference table of common values
Below are precomputed Adler-32 checksums for several short strings. You can use them to verify your own results or test another implementation.
| Input | S1 | S2 | Adler-32 (hex) |
|---|---|---|---|
| (empty) | 1 | 0 | 00000001 |
| a | 98 | 98 | 00620062 |
| ab | 196 | 294 | 012600C4 |
| abc | 297 | 591 | 024F0129 |
| Wikipedia | 920 | 4582 | 11E60398 |
Notice that the empty string produces 00000001 because S1 begins at 1 and no bytes are processed.
Where Adler-32 is used
The most prominent use of the Adler-32 checksum is inside the zlib compression format specified by RFC 1950. Every zlib stream ends with four bytes that hold the Adler-32 of the uncompressed data, allowing decompressors to detect corruption quickly.
The rsync file synchronization tool also relies on a rolling version of Adler-32 to identify matching blocks between files. Because addition and modulo operations are far cheaper than the polynomial division required by CRC-32, Adler-32 suits applications where throughput matters more than cryptographic strength. If you need stronger integrity checks, consider a tool like the CRC calculator or a full hash generator.
Adler-32 compared to CRC-32
Both Adler-32 and CRC-32 produce 32-bit checksums, but they differ in speed and reliability. Adler-32 uses simple addition modulo a prime, making it significantly faster in software. CRC-32 uses polynomial division over GF(2), which catches burst errors more effectively.
For very short messages, Adler-32 has a weakness: the S2 accumulator does not have time to spread across many values, so different short inputs may collide more often than they would under CRC-32. For large streams such as compressed files, the difference in collision probability becomes negligible for non-adversarial corruption. Choose Adler-32 when speed is critical and the threat model involves accidental errors rather than deliberate tampering.
Handling hexadecimal input
When you select the hexadecimal mode, this adler32 calculator interprets each pair of characters as one byte. Spaces and other whitespace are ignored, so you can paste formatted hex dumps directly. An odd number of hex digits or invalid characters will produce an error.
For example, the hex string 48656c6c6f represents the five bytes 0x48, 0x65, 0x6C, 0x6C, 0x6F, which correspond to the ASCII word "Hello". Processing those five bytes through the algorithm yields the checksum 058C01F5. Hex mode is especially useful when verifying binary file headers or network packets where the raw bytes are already known.
Worked examples
| Example | Input | Result |
|---|---|---|
| Wikipedia example | Input: Wikipedia; Input format: text | Adler-32 (hex): 11E60398; Adler-32 (decimal): 300,286,872; S1: 920; S2: 4,582; Bytes processed: 9 |
| Empty string | Input format: text | Adler-32 (hex): 00000001; Adler-32 (decimal): 1; S1: 1; S2: 0; Bytes processed: 0 |
| Hex bytes | Input: 48656c6c6f; Input format: hex | Adler-32 (hex): 058C01F5; Adler-32 (decimal): 93,061,621; S1: 501; S2: 1,420; Bytes processed: 5 |
| Single character | Input: a; Input format: text | Adler-32 (hex): 00620062; Adler-32 (decimal): 6,422,626; S1: 98; S2: 98; Bytes processed: 1 |
FAQ
What is an Adler-32 checksum?
Adler-32 is a 32-bit checksum algorithm created by Mark Adler. It combines two 16-bit sums computed modulo 65521 to detect accidental changes in data.
Why does the empty string return 00000001?
The S1 accumulator is initialized to 1 before any bytes are processed. With zero bytes, S1 remains 1 and S2 remains 0, producing the hex value 00000001.
Is Adler-32 cryptographically secure?
No. Adler-32 is designed for fast error detection, not security. It is trivial to craft collisions deliberately. Use SHA-256 or similar algorithms for cryptographic needs.
Can I paste a hex dump with spaces?
Yes. When the input format is set to hexadecimal, all whitespace is stripped before parsing, so spaced hex dumps work correctly.
What does RFC 1950 specify?
RFC 1950 defines the zlib compressed data format, which mandates the Adler-32 checksum for verifying the integrity of decompressed data.
Does this adler32 calculator upload my data?
No. All computation happens locally in your browser. Nothing is sent to any server.