Error Detection Code - Checksum
Last Updated :
07 Oct, 2025
A checksum is an error detection method used by upper-layer protocols. It is considered to be more reliable than Longitudinal Redundancy Check (LRC), Vertical Redundancy Check (VRC), and Cyclic Redundancy Check (CRC).
- This method uses a Checksum Generator on the sender side.
- A Checksum Checker is used on the receiver side.
- The checksum is a unique number generated from the data to verify its integrity.
- If the two checksums match, the data is likely error-free.
How Checksum work?
Checksum works by summing all data segments using 1’s complement arithmetic, taking the complement of the result, appending it to the data, and verifying at the receiver by checking if the final complemented sum (including checksum) equals zero.

Sender Side:
- Data Division: The data is divided into equal-sized subunits of n bits (commonly 16 bits).
- Addition Using 1’s Complement: All the subunits are added together using 1’s complement arithmetic. If a carry is generated beyond the most significant bit, it is wrapped around and added to the least significant bit.
- Checksum Calculation: The final sum is then complemented (1’s complement). This result is known as the checksum.
- Transmission: The original data along with the checksum is transmitted to the receiver as a single unit.
Receiver Side:
- Receiving Data and Checksum: The receiver gets the combined block of original data and checksum.
- Data Division: The received block is divided into subunits of n bits, same as at the sender side.
- Addition Using 1’s Complement: All subunits, including the checksum, are added together using 1’s complement addition with end-around carry.
- Final Complement and Validation: The result of the sum is complemented. If the final result is all zeros, the data is considered to be error-free.
- Error Detection: If the result is non-zero, it indicates that an error has occurred during transmission, and the receiver rejects the data.
Factors Inconsistent Checksum Number
Whenever checksum values doesn't matches, it seems that some disturbance happened in the data during transmission. There are several factors which can create disturbance are mentioned below:
- Interruption in the network connection can create inconsistent checksum number.
- Issue in the storage space or hard drives can also lead to problem in checksum.
- Corrupted Disk and Corrupted File can lead to error in Checksum.
- If a third party infers while transferring the data, it can also lead to checksum.
Example 1 - If the data unit to be transmitted is 10101001 00111001, the following procedure is used at Sender site and Receiver site.
Sender Site:
10101001 subunit 1
00111001 subunit 2
11100010 sum (using 1s complement)
00011101 checksum (complement of sum)
Data transmitted to Receiver is:
Checksum - ExampleReceiver Site:
10101001 subunit 1
00111001 subunit 2
00011101 checksum
11111111 sum
00000000 sum's complement
Result is zero, it means no error.
Example 2 - If the data transmitted along with checksum is 10101001 00111001 00011101. But the data received at destination is 00101001 10111001 00011101.
Receiver Site:
00101001 1st bit of subunit 1 is damaged
10111001 1st bit of subunit 2 is damaged
00011101 checksum
11111111 sum
00000000 Ok 1's complement
Although data is corrupted, the error is undetected. Because the changes in data 1 and data 2 offset each other, resulting in the same overall sum. This is a limitation of simple checksum – it cannot detect all types of errors, especially when multiple errors cancel each other out.
Explore
Computer Network Basics
Physical Layer
Data Link Layer
Network Layer
Transport Layer
Session Layer & Presentation Layer
Application Layer
Advanced Topics
Practice