Checksum Calculator

Calculate checksums using various algorithms for data integrity verification.

Input Data

Checksums

Sum mod 256
8-bit sum of bytes
0x1C
(28)
XOR
XOR of all bytes
0x20
(32)
Two's Complement
Negated sum
0xE4
(228)
LRC
Longitudinal Redundancy Check
0xE4
(228)
CRC-8
Cyclic Redundancy Check 8-bit
0x25
(37)
Fletcher-16
16-bit Fletcher checksum
0x1820
(6176)
Internet Checksum
RFC 1071 checksum
0xAE31
(44593)
Adler-32
32-bit Adler checksum
0x180B041D
(403375133)

Note: Checksums are used to detect errors in data transmission or storage. Different algorithms offer varying levels of error detection capability.

What Is a Checksum?

A checksum is a small fixed-size value derived from a block of data using a mathematical algorithm. Its primary purpose is data integrity verification β€” if even a single bit of the original data changes, the recomputed checksum will differ from the stored one, immediately flagging the corruption or transmission error.

Checksums have been a cornerstone of reliable computing since the earliest days of digital communication. Every time you download a file, send a network packet, or write data to a disk, checksums are silently working behind the scenes to confirm that what arrived matches what was sent. They are lighter-weight than full cryptographic hash functions (like SHA-256), making them ideal for high-throughput scenarios where speed matters more than security.

This checksum calculator computes eight different algorithms simultaneously β€” Sum mod 256, XOR, Two's Complement, LRC, CRC-8, Fletcher-16, Internet Checksum, and Adler-32 β€” so you can compare outputs, verify data, or study how each algorithm responds to your input. Simply enter text in the input box and all checksums update instantly.

It is important to distinguish checksums from cryptographic hashes. Checksums are designed to detect accidental errors (bit flips, dropped bytes), not malicious tampering. An attacker who knows the algorithm can easily craft data that produces the same checksum. For security-sensitive uses, always reach for a proper cryptographic hash.

How Checksums Work β€” Formulas Explained

Each algorithm in this calculator operates on the raw byte values (ASCII codes) of your input string. Here is how the two most commonly referenced algorithms are computed, matching the exact formulas used in this tool.

Sum mod 256 (8-bit Byte Sum)

The simplest checksum adds up every byte value in the input, then takes the remainder when divided by 256. The result is always a single byte (0–255).

Adler-32

Adler-32 maintains two running accumulators, a and b, both taken modulo 65521 (the largest prime below 216). The accumulator a starts at 1 and adds each byte; b accumulates the running value of a. The final 32-bit result packs b into the high 16 bits and a into the low 16 bits.

Fletcher-16 follows a similar dual-accumulator pattern but uses modulo 255 instead of a prime, making it slightly simpler to implement in hardware. The Internet Checksum (RFC 1071) treats the data as 16-bit words, sums them, folds any carry bits back in, and returns the one's complement β€” this is the checksum used in IP, TCP, and UDP headers.

The XOR checksum reduces all bytes with the exclusive-OR operation. It detects any single-bit error and any odd number of identical errors, but it cannot detect even numbers of the same bit flipping. Two's Complement and LRC (Longitudinal Redundancy Check) are close relatives of the byte-sum approach; both negate the final sum so that XOR-ing the data bytes with the checksum byte yields zero β€” a common self-check pattern in serial protocols.

CRC-8 uses a feedback shift register driven by polynomial division (polynomial 0x07 in this tool). It is significantly better at catching burst errors than simple additive methods, which is why CRC variants are used in storage (CRC-32 in ZIP files, CRC-16 in MODBUS).

Adler-32 Checksum

a = (1 + Ξ£ byteα΅’) mod 65521 ; b = (Ξ£ aα΅’) mod 65521 ; Adler-32 = (b << 16) | a

Where:

  • byteα΅’= ASCII code of the i-th character in the input string
  • a= Running byte sum accumulator, initialized to 1, taken mod 65521
  • b= Running sum-of-sums accumulator, initialized to 0, taken mod 65521
  • <<= Bitwise left shift β€” places b in the upper 16 bits of the 32-bit result
  • |= Bitwise OR β€” combines the high (b) and low (a) 16-bit halves

Comparing the Eight Algorithms

Not all checksum algorithms are equal. They differ in output width, error-detection capability, and computational cost. The table below summarises the eight algorithms computed by this tool.

Algorithm Width Detects Typical Use
Sum mod 256 8-bit Single-byte errors Simple serial protocols
XOR 8-bit Odd-count bit flips NMEA GPS sentences
Two's Complement 8-bit Same as Sum mod 256 Bootloader verification
LRC 8-bit Single-byte errors ISO 1155, MODBUS ASCII
CRC-8 8-bit Burst errors up to 8 bits Embedded systems, 1-Wire
Fletcher-16 16-bit All single-byte, most burst Adlets, OSI network layer
Internet Checksum 16-bit All single-bit errors IP / TCP / UDP headers
Adler-32 32-bit Most multi-byte errors zlib / PNG / gzip streams

Wider checksums have a lower collision probability. A 32-bit checksum has roughly a 1-in-4-billion chance of a false match, whereas an 8-bit checksum matches randomly 1 time in 256. For large files or high-reliability applications, always prefer wider algorithms such as CRC-32 or Adler-32.

Real-World Use Cases for Checksums

Checksums appear in virtually every layer of modern computing. Understanding where each algorithm is applied helps you choose the right one for your own project.

Network protocols rely heavily on checksums. The Internet Checksum (RFC 1071) is embedded in every IPv4, TCP, and UDP header. Routers and network stacks verify this value on every packet, discarding corrupt ones silently rather than forwarding bad data. The calculation is fast enough to run in hardware at line speed on gigabit links.

File downloads and software distribution frequently publish a checksum alongside the download so you can confirm the file arrived intact. Linux ISO images, firmware packages, and open-source tarballs typically ship an Adler-32 or CRC-32 value for this reason.

Embedded systems and serial communication use lightweight 8-bit algorithms because microcontrollers have limited processing power and memory. The XOR checksum is popular in NMEA 0183 sentences (GPS data), while MODBUS ASCII uses LRC and CRC-based variants are standard in industrial automation.

Storage systems use checksums to detect bit-rot β€” the gradual corruption of stored data over years. File systems such as ZFS compute checksums over every written block and re-verify them on each read, automatically triggering scrubs when mismatches are detected.

Streaming compression is where Adler-32 and Fletcher-16 shine. The zlib library (used inside PNG, gzip, and HTTP content-encoding) appends an Adler-32 to compressed streams. It is faster to compute than CRC-32 while offering comparable detection strength for the data sizes typically compressed by zlib.

When you use this checksum calculator for your own work, consider the trade-off between speed and detection strength. If you are writing a simple sensor protocol and can afford only one byte of overhead, XOR or Sum mod 256 may be sufficient. If you are protecting a firmware image, CRC-8 or Fletcher-16 are safer choices. For multi-kilobyte or larger data blocks where a 32-bit result is acceptable, Adler-32 is an excellent balance of speed and reliability.

Checksums vs. Cryptographic Hash Functions

A common source of confusion is the difference between checksums and cryptographic hash functions such as MD5, SHA-1, and SHA-256. Both produce a fixed-size fingerprint of arbitrary data, but they serve different purposes and offer very different guarantees.

Checksums are optimised for speed and for detecting accidental errors. An adversary who knows the algorithm can trivially compute inputs that produce any desired checksum value. This makes checksums completely unsuitable as a security mechanism β€” they cannot verify authenticity, and they provide no protection against deliberate tampering.

Cryptographic hash functions are deliberately designed to be computationally infeasible to reverse or to forge. Finding two different inputs that produce the same SHA-256 output (a "collision") is considered practically impossible with current computing power. They are appropriate for password storage (when combined with a salt), digital signatures, certificate fingerprinting, and software authenticity checks.

If your goal is to verify that a file you downloaded has not been tampered with by a malicious third party, a simple checksum is not enough β€” you need a signed hash (e.g., a GPG-signed SHA-256 digest). If your goal is simply to confirm that a file copied over a noisy network link arrived with all bytes intact, a fast checksum is the right tool.

This checksum calculator is ideal for development, debugging, education, and lightweight data-integrity tasks. For security-critical applications, combine it with a proper cryptographic approach.

Worked Examples

Single Character: "A"

Problem:

Compute the Sum mod 256, XOR, and Two's Complement checksum for the single-character input "A" (ASCII 65 = 0x41).

Solution Steps:

  1. 1Identify the ASCII byte value: 'A' = 65.
  2. 2Sum mod 256: 65 mod 256 = 65 β†’ hex 0x41.
  3. 3XOR checksum: XOR of a single byte is the byte itself β†’ 65 β†’ hex 0x41.
  4. 4Two's Complement: (~65 + 1) & 0xFF = (βˆ’66 + 1) & 0xFF = βˆ’65 & 0xFF = 256 βˆ’ 65 = 191 β†’ hex 0xBF.
  5. 5LRC complement equals Two's Complement for a single byte β†’ 191 β†’ hex 0xBF.

Result:

Sum mod 256: 0x41 (65) | XOR: 0x41 (65) | Two's Complement: 0xBF (191) | LRC: 0xBF (191)

Two Characters: "Hi" (H=72, i=105)

Problem:

Compute the Sum mod 256, Fletcher-16, and XOR checksum for the input "Hi".

Solution Steps:

  1. 1Byte values: 'H' = 72, 'i' = 105.
  2. 2Sum: 72 + 105 = 177; Sum mod 256 = 177 = 0xB1.
  3. 3XOR: 72 XOR 105 = (01001000) XOR (01101001) = 00100001 = 33 = 0x21.
  4. 4Fletcher-16 step 1 β€” process 'H' (72): sum1 = (0 + 72) mod 255 = 72; sum2 = (0 + 72) mod 255 = 72.
  5. 5Fletcher-16 step 2 β€” process 'i' (105): sum1 = (72 + 105) mod 255 = 177; sum2 = (72 + 177) mod 255 = 249.
  6. 6Fletcher-16 result: (249 << 8) | 177 = 63921 = 0xF9B1.

Result:

Sum mod 256: 0xB1 (177) | XOR: 0x21 (33) | Fletcher-16: 0xF9B1 (63921)

Three Characters: "ABC" (A=65, B=66, C=67)

Problem:

Compute the Sum mod 256, XOR, and Two's Complement checksum for "ABC".

Solution Steps:

  1. 1Byte values: 'A' = 65, 'B' = 66, 'C' = 67.
  2. 2Sum: 65 + 66 + 67 = 198; Sum mod 256 = 198 = 0xC6.
  3. 3XOR step 1: 65 XOR 66 = (01000001) XOR (01000010) = 00000011 = 3.
  4. 4XOR step 2: 3 XOR 67 = (00000011) XOR (01000011) = 01000000 = 64 = 0x40.
  5. 5Two's Complement of sum 198: (~198 + 1) & 0xFF = (βˆ’199 + 1) & 0xFF = βˆ’198 & 0xFF = 256 βˆ’ 198 = 58 = 0x3A.
  6. 6LRC: running (acc + byte) & 0xFF β†’ 65 β†’ 131 β†’ 198; complement = 58 = 0x3A.

Result:

Sum mod 256: 0xC6 (198) | XOR: 0x40 (64) | Two's Complement: 0x3A (58) | LRC: 0x3A (58)

Adler-32 for "Hi" (H=72, i=105)

Problem:

Manually compute the Adler-32 checksum for the two-character input "Hi".

Solution Steps:

  1. 1Initialize: a = 1, b = 0.
  2. 2Process 'H' (72): a = (1 + 72) mod 65521 = 73; b = (0 + 73) mod 65521 = 73.
  3. 3Process 'i' (105): a = (73 + 105) mod 65521 = 178; b = (73 + 178) mod 65521 = 251.
  4. 4Combine: Adler-32 = (b << 16) | a = (251 Γ— 65536) + 178 = 16449714 = 0x00FB00B2.

Result:

Adler-32: 0x00FB00B2 (16449714)

Tips & Best Practices

  • βœ“Paste a short test string first to understand how each algorithm responds before applying to real data.
  • βœ“XOR is the fastest checksum to compute in both software and hardware β€” use it when byte overhead must be minimal.
  • βœ“Adler-32 is used inside every PNG image and gzip file β€” it is the most widely deployed checksum in file formats.
  • βœ“Two equal-length inputs that are byte-for-byte swaps of each other produce the same XOR checksum β€” XOR cannot detect transpositions.
  • βœ“Use the hex output (0x prefix) when comparing checksums against protocol documentation, which almost always expresses values in hexadecimal.
  • βœ“Fletcher-16 and Adler-32 both use a dual-accumulator design, giving them positional sensitivity that pure sum-based methods lack.
  • βœ“Copy the hex value directly from any result row using the Copy button β€” useful when pasting into protocol frames or configuration files.
  • βœ“A mismatch between the expected and computed checksum means at least one byte changed; it does not tell you which byte or how many changed.

Frequently Asked Questions

A checksum is a lightweight value used to detect accidental data errors such as bit flips during transmission or storage. It is optimised for speed and simplicity. A cryptographic hash (MD5, SHA-256, etc.) is designed to be collision-resistant and one-way, making it suitable for security tasks like password storage and digital signatures. An attacker can forge a checksum deliberately; forging a cryptographic hash is computationally infeasible.
For lightweight serial communication (UART, MODBUS ASCII), XOR or LRC are common choices because they fit in one byte and are trivial to compute in firmware. For network packets, the Internet Checksum (RFC 1071) is the standard. For compressed data streams or moderate-length files, Adler-32 or Fletcher-16 offer better error coverage. For industrial storage or firmware images, prefer CRC-8 or ideally CRC-32, which is not shown here but is widely available in libraries.
No. A checksum can tell you the data looks intact, but it cannot prove no modification occurred. Because checksum algorithms are public knowledge, any attacker who wants to alter data can simply recalculate the checksum to match the tampered content. If you need tamper detection or authenticity guarantees, use a cryptographic MAC (Message Authentication Code) or a digitally signed hash instead.
Both Two's Complement and LRC in this calculator compute the arithmetic negation of the running byte sum, masked to 8 bits. The difference is in how they accumulate. The Two's Complement is applied to sumMod256 (the full sum mod 256), while LRC accumulates with an & 0xFF mask on every step. For most inputs the values match, but they can diverge when intermediate sums exceed 255 and the two masking strategies interact differently over many bytes.
RFC 1071 defines the Internet Checksum as the one's complement of the one's complement sum of 16-bit words in the data. It is used in the headers of IPv4, TCP, UDP, and ICMP packets. Every router and operating system network stack computes and verifies this value on every packet. The one's complement design means that a receiver can verify a packet by summing all words including the checksum field β€” a valid packet will yield all 1s (0xFFFF).
65521 is the largest prime number less than 2^16 (65536). Using a prime modulus gives Adler-32 better mathematical distribution properties and ensures the algorithm detects certain error patterns that a power-of-two modulus would miss. The original designer, Mark Adler, chose this prime specifically to avoid the statistical weaknesses of modulo 2^n arithmetic. The small performance cost of one extra modulo operation is outweighed by the improved detection strength.
This tool computes the algorithms shown (Sum mod 256, XOR, LRC, CRC-8, Fletcher-16, Adler-32, Internet Checksum) on text input. Most published file checksums use CRC-32, MD5, SHA-1, or SHA-256, which are not in this calculator. This tool is best used for educational purposes, protocol debugging, and verifying small text payloads. For downloaded file verification, use your operating system's built-in commands such as sha256sum or certutil.

Sources & References

Last updated: 2026-06-05

πŸ’‘

Help us improve!

How would you rate the Checksum Calculator?

<>

Editorial Note

MyCalcBuddy Editorial Team

This page is maintained as an educational calculator reference.

Source

Formula Source: Standard Mathematical References

by Various

UpdatedLast reviewed: May 2026
CheckedFormula checks are based on standard references and internal QA review.