Introduction
Working with TCP headers or ADCCP frames and need to verify a Fletcher-32 checksum? Fletcher-32 is a checksum algorithm developed by John Fletcher at Lawrence Livermore National Laboratory in the late 1970s. It computes two modular sums over 16-bit words and combines them into a 32-bit value. This tool computes the Fletcher-32 checksum for any text input. Paste your data and get the 8-character hex result instantly. No data leaves your browser.
What this tool does
- Computes the Fletcher-32 checksum using two 16-bit running sums modulo 65535 over 16-bit words.
- Outputs an 8-character hexadecimal string representing the 32-bit checksum.
- Processes input as UTF-8 bytes, grouping them into 16-bit words (little-endian).
- Updates the checksum in real time as you type.
- Runs entirely client-side with no network requests.
How this tool works
Type or paste text into the input field. The tool encodes the text as UTF-8 bytes and groups them into 16-bit words (padding the last byte with zero if the byte count is odd). It then computes two running sums: sum1 (sum of each word modulo 65535) and sum2 (running sum of sum1 values modulo 65535). The final checksum is (sum2 << 16) | sum1, displayed as an 8-character lowercase hex string.
How Fletcher-32 works
Fletcher-32 is part of a family of checksums developed by John G. Fletcher at Lawrence Livermore National Laboratory. The family includes Fletcher-8, Fletcher-16, Fletcher-32, and Fletcher-64, each operating on different word sizes. Fletcher-32 operates on 16-bit words and produces a 32-bit checksum.
The algorithm computes two running sums over the data: - sum1 accumulates the sum of each 16-bit word, modulo 65535. - sum2 accumulates the running sum of sum1 after each word, modulo 65535.
Both sums start at 0. The final checksum is `(sum2 << 16) | sum1`. The modulus 65535 (2^16 - 1) is used because it is the largest value that fits in 16 bits and provides good error detection properties.
Fletcher-32 is used in several networking and communication standards: - TCP uses a variant of Fletcher's algorithm for its header checksum (though the TCP checksum is technically a one's complement sum, not a true Fletcher-32). - ADCCP (Advanced Data Communication Control Procedures, ANSI X3.66) uses Fletcher-32 for frame integrity. - The UDT protocol (UDP-based Data Transfer) uses Fletcher-32 for packet checksums.
Fletcher-32 is similar to Adler-32 but uses modulus 65535 instead of 65521 (the largest prime under 2^16). Fletcher-32 provides slightly better error detection for short messages because the modulus is larger, allowing the sums to grow more before wrapping. However, Adler-32's use of a prime modulus provides better mixing properties for certain error patterns.
How to use this tool
- Type or paste the text you want to checksum into the input field.
- The Fletcher-32 value appears instantly as an 8-character hex string.
- Click the Copy button to copy the checksum to your clipboard.
- Compare the result against a known Fletcher-32 value to verify data integrity.
Real-world examples
Verifying a UDT packet checksum
The UDT protocol uses Fletcher-32 for packet integrity. A developer debugging UDT transfers computes Fletcher-32 over a packet payload and compares it against the checksum in the packet header. Input: the packet payload bytes (as text). Output: an 8-character hex string that should match the header checksum.
ADCCP frame validation
An engineer working with ADCCP (ANSI X3.66) frames needs to verify the frame check sequence. She computes Fletcher-32 over the frame data (excluding the FCS field) and compares the result against the 4-byte FCS at the end of the frame. A match indicates the frame was received without corruption.
Comparing Fletcher-32 with Adler-32
A developer choosing a checksum for a custom protocol hashes the same input with both Fletcher-32 and Adler-32. Input: 'hello world'. Fletcher-32 output: '0e280fcd'. Adler-32 output: '1e4a04a2'. Both are 32-bit values but use different moduli (65535 vs 65521) and different word sizes (16-bit vs 8-bit).
Comparison with similar methods
| Method | Complexity | Typical use |
|---|---|---|
| Fletcher-32 | O(n), two modular sums over 16-bit words | TCP, ADCCP, UDT |
| Adler-32 | O(n), two modular sums over 8-bit bytes | zlib, PNG, deflate |
| CRC32 (IEEE 802.3) | O(n), table-driven polynomial | Ethernet, gzip, PNG |
| Fletcher-16 | O(n), two modular sums over 8-bit bytes | ADCCP (older variant) |
Limitations or considerations
Fletcher-32 is a checksum, not a cryptographic hash. It detects accidental corruption but provides no security against intentional tampering. For messages shorter than 2^16 words, Fletcher-32 detects all single-bit errors and most multi-bit errors, but it is weaker than CRC32 for detecting burst errors. For security-sensitive integrity verification, use SHA-256 or BLAKE2. This tool processes text input only and cannot directly checksum binary data.
Frequently asked questions
What is the difference between Fletcher-32 and Adler-32?
Fletcher-32 operates on 16-bit words with modulus 65535, while Adler-32 operates on 8-bit bytes with modulus 65521. Fletcher-32 starts both sums at 0, while Adler-32 starts s1 at 1. Fletcher-32 provides slightly better detection for short messages, while Adler-32's prime modulus provides better mixing for certain error patterns.
Is the TCP checksum the same as Fletcher-32?
No, but they are related. The TCP checksum is a one's complement sum of 16-bit words over the pseudo-header, TCP header, and data. Fletcher-32 uses modular sums with a specific modulus. Both detect similar classes of errors, but they produce different values for the same input.
Why does Fletcher-32 use modulus 65535 instead of 65536?
Using modulus 65535 (2^16 - 1) instead of 65536 (2^16) ensures that the sums wrap around before reaching the maximum 16-bit value. This provides better error detection because a sum of 65535 and a sum of 0 produce different checksum values, whereas with modulus 65536 they would be identical.
Can Fletcher-32 detect all burst errors?
Fletcher-32 detects all burst errors of 16 bits or fewer for messages shorter than 2^16 words. For longer bursts, detection depends on the specific error pattern. CRC32 provides stronger burst error detection guarantees.
Conclusion
This Fletcher-32 checksum tool computes the algorithm used in TCP, ADCCP, and UDT protocols. It runs entirely in your browser and updates instantly. For related checksum tools, try the Adler-32 Checksum, the CRC64 Calculator, or the Checksum Calculator.