View All
View All
View All
View All
View All
View All
View All
View All
View All
View All
View All
View All
View All

What is Checksum & How it Works?

By Pavan Vadapalli

Updated on Mar 01, 2025 | 9 min read | 6.9k views

Share:

Checksums are an essential component of the IP protocol, the underlying technology that enables the internet to function. But what is checksum exactly? It is an error-detection mechanism that helps verify data integrity during transmission and storage. The checksum method implements error checking using bit addition and bit complement techniques, ensuring that data remains accurate and uncorrupted.

Using a checksum or other error-detection approach is necessary to identify any damage to the data while it is being transported across the network channel. 

This blog will explain what is checksum with examples, how it works, and the many types. Continue reading to learn how to use checksums on different operating systems.

What Is Checksum?

Checksum is a technique used to determine the authenticity of received data and to detect whether there was an error in transmission. It is an error detection algorithm that adjoins redundant bits in a message for detecting errors and is capable of working on any message length. Before transmission, every piece of data or file might be issued a checksum value after executing a cryptographic hash function. 

Checksums function by giving the party on the receiving end information about the transmission to ensure that the complete range of data is transmitted. The checksum value is often a long string of letters and numbers that operate as a fingerprint for a file or set of files to identify the number of bits contained in the transmission. 

Checksums are frequently called hash values or unique numbers generated by cryptographic techniques and work like digital data fingerprints. Creating and comparing checksums is sometimes called ‘fixity checking’. Checksums are used to test data integrity and discover data corruption problems. Checksum functions are linked to hash functions, fingerprints, randomisation, and cryptographic hash functions.

Why Use Checksum?

Here are the reasons to use checksum:

  • Error detection: A checksum facilitates the identification of potential faults that could occur while transmitting data. This lets the recipient juxtapose the received data with the provided checksum value. When a disparity between the checksum and the received data exists, it indicates errors or alterations within the data.
  • Data integrity: Checksums are crucial in preserving data’s integrity and protecting it against tampering or corruption during storage and transit. A comparison between the computed and the received checksum makes it possible to ascertain whether the data has remained unaltered.
  • Anomaly identification: A checksum is produced and sent together with the data before transferring data. The recipient then calculates its checksum from the received data and compares it with the checksum. If they don’t match, it signals that something went wrong in the transmission.
  • Data fidelity: Checksums confirm that the entire dataset has been correctly transferred. If any part of the data is lost or altered during transmission, the checksum will likely not match, indicating a problem.
  • Error localisation: In some circumstances, checksums might help determine where mistakes occurred. By breaking the data into smaller chunks and calculating checksums for each chunk, faults can be traced to specific data segments.
  • Quick verification: Checksums are generally quick and easy to calculate. This makes them efficient for checking data integrity, especially when working with enormous amounts of information.
  • Security: In cryptographic applications, checksums are used to produce digital signatures and verify the authenticity of data. Strong cryptographic checksums provide a layer of protection against unwanted alterations.

Checksum Algorithm Types

Types of Checksum Algorithms

To understand what is checksum, it's essential to explore the different algorithms that help detect errors in data transmissions and verify data integrity. Here are some common types:

  • Longitudinal Parity Check: This is the simplest checksum procedure. It splits the input into “words” with a specified amount of bits and computes the exclusive or (XOR) of all those words. The result is attached to the message as an additional word.
  • Fletcher’s Checksum: Fletcher’s checksum technique is designed to identify flaws that affect many bits at once. It employs a mix of addition and modulo operations to generate the checksum.
  • Adler-32: Adler-32 is a checksum method that fairly balances speed and error detection capability. It employs modular arithmetic techniques to calculate the checksum.
  • Cyclic Redundancy Checks (CRCs): CRCs are commonly used checksum algorithms that can identify various mistakes. They employ polynomial division to calculate the checksum.
  • Cryptographic Hash Functions: Cryptographic hash functions, for example, MD5, SHA-1, SHA-256, and SHA-512, find utility in creating cryptographic checksums. These algorithms conduct multiple mathematical processes to obtain a fixed-length hash value that works as a checksum to validate the integrity of a file.

Check out our free technology courses to get an edge over the competition.

Step-By-Step Guide to the Checksum Error-Detection Technique 

The checksum approach requires a checksum generator on the sender's side and a checksum checker on the receiver's side. To understand what is checksum, it is essential to know how it functions.  

The process entails splitting the data into fixed-sized segments and employing a 1’s complement to find the sum of these segments. The calculated sum is then transmitted simultaneously with the data to the addressee. 

At the receiver’s end, the same operation is repeated, and if all zeroes are reached in the total, the data is legitimate. If the result is non-zero, it signals the data comprises a mistake, and the receiver rejects it. 

The checksum identifies all the faults involving an odd number of bits and the mistakes involving an even number of bits. The main problem of the checksum technique is that the error goes unnoticed if one or more bits of a subunit are erroneous.

The checksum error-detection method involves the following steps:

  • Checksum generator: The sender employs a checksum generator to determine the checksum of the data to be delivered.
  • Adding checksum to data: The checksum is attached to the data and transmitted to the recipient.
  • Checksum checker: The receiver uses a checksum checker to confirm whether the correct data is received.
  • Dividing data into subunits: The receiver separates the received data unit into multiple subunits of equal length.
  • Adding subunits: The receiver adds all these subunits, including the checksum as one of the subunits.
  • Complementing resulting bit: The resulting bit is then complemented.
  • Error detection: The data is error-free if the complemented result is zero. If the result is non-zero, it signifies the data includes an error, and the receiver rejects it.

Check Out upGrad’s Software Development Courses to upskill yourself.

Checksum on the Sender’s End [Step wise]

The sender side performs the checksum procedure by dividing the original data into blocks, adding them, complementing the result, and getting the checksum. The checksum is subsequently added to the original data bit and data transmission resumes.

To understand what is checksum, it is important to explore the steps involved in its error-detection approach on the sender’s side:

  • Divide the original data into n-bit chunks in each block.
  • Add all k data blocks together.
  • The addition result is supplemented by the complement of one.
  • The data acquired is called the checksum.
  • Combine the checksum value with the original data bit.
  • Start the data transfer.

Checksum at the Receiver End [Step wise]

Here are the step-by-step instructions for checksum at the receiver side:

  • Divide the supplied data into ‘k’ pieces.
  • Add the checksum value to each of the ‘k’ data blocks.
  • The addition result is supplemented by the complement of one.
  • If the result is 0, there are no mistakes in the data received from the sender, and the receiver accepts the data.
  • If the result is non-zero, the data includes an error, and the receiver rejects it.

Detecting Checksum Errors: A Solved Example

Here is an example of using checksum for error detection:

Assume we wish to send the following 8-bit data: 11010011. We may employ a simple checksum approach to detect flaws in this message.

  • Separate the data into four-bit segments 1101 and 0011.
  • Using 1’s complement arithmetic, add the segments: 1101 + 0011 = 10000.
  • Remove the carry bit and take the result’s 1’s complement: 0111.
  • To generate the sent message, append the checksum to the original data: 110100110111.
  • Divide the received message into four 4-bit segments: 1101, 0011, and 0111.
  • Using 1’s complement arithmetic, add the segments: 1101 + 0011 + 0111 = 10011.
  • Remove the carry bit and take the result’s 1’s complement: 0110.
  • If the result is 0, the received frames are considered error-free. If the result is non-zero, it signifies the data includes an error, and the receiver rejects it.

This example demonstrates how to use a checksum to detect problems in data transport. Upper-layer protocols employ checksums as a reliable error detection approach.

Sender End [Step wise]

Here is a step-by-step example of checksum error detection at the sender side:

  • Divide the data: Divide the original data into blocks of a specific number of bits.
  • Add the data blocks: Combine all of the data blocks.
  • Complement the result: Using 1’s complement, take the complement of the addition result.
  • Obtain the checksum: The checksum is the acquired data after complementing.

Let’s take an example to illustrate these steps:

  • Suppose we have the following data to be transmitted: 10110101.
  • Divide the data: Divide the data into blocks with a certain number of bits in each block. Let’s assume we divide it into 4-bit blocks: 1011 and 0101.
  • Add the data blocks: Add all the data blocks together: 1011 + 0101 = 10000.
  • Complement the result: Take the complement of the addition result using 1’s complement: 01111.
  • Obtain the checksum: The resulting data after complementing is known as the checksum. In this situation, the checksum is 01111.

The sender will then transfer the original data with the checksum to the recipient. The receiver will conduct the identical processes to produce the checksum and compare it with the received checksum to discover any flaws in the data transmission.

Note: This is only a simplified example of checksum error detection stages. In practice, more advanced algorithms and error detection methods may be used.

Receiver End [Step wise]

Here are the in-depth directions for the receiver side of a solved checksum error detection example:

  • Receive the sender’s data and checksum.
  • Divide the data into equal-sized pieces.
  • Add all of the blocks, including the checksum.
  • Take the sum’s complement.
  • If the complement is 0, the data is error-free and acceptable.
  • If the complement is greater than zero, the data is incorrect and should be disregarded.

Upper-layer protocols employ this form of error detection, deemed more trustworthy than other methods such as LRC, VRC, and CRC. Checksum error detection entails computing a number known as the checksum to determine whether or not the data transported from the sender to the receiver has been corrupted. The transmitter uses the checksum generator to check for mistakes, while the receiver uses the checksum checker. The checksum detects any faults involving an odd number of bits and errors involving an even number of bits.

Coverage of AWS, Microsoft Azure and GCP services

Certification8 Months
View Program

Job-Linked Program

Bootcamp36 Weeks
View Program

Conclusion

Understanding what is checksum is essential for ensuring data integrity in digital communication and storage. A checksum is a value derived from a data set, allowing systems to detect accidental errors during transmission. By comparing the computed checksum at the sender and receiver ends, any discrepancies can be identified, ensuring accurate data transfer.

In networking, what is checksum in networking is a key concept used in protocols like TCP, IP, and UDP. It helps verify packet integrity, prevent data corruption, and ensure seamless communication across networks. This makes checksums a fundamental tool for maintaining reliable and error-free data transmission.

Frequently Asked Questions

1. What is a checksum in data engineering?

2. Why is a checksum important?

3. What is a checksum algorithm?

4. What is checksum and CRC?

5. What is a checksum and how does it work?

6. How does checksum detect errors?

7. How does internet checksum work?

8. How does checksum work in SQL?

9. What is the difference between checksum and hash?

10. Can checksum correct errors?

11. Is checksum used in cybersecurity?

Pavan Vadapalli

899 articles published

Get Free Consultation

+91

By submitting, I accept the T&C and
Privacy Policy

India’s #1 Tech University

Executive PG Certification in AI-Powered Full Stack Development

77%

seats filled

View Program

Top Resources

Recommended Programs

upGrad

AWS | upGrad KnowledgeHut

AWS Certified Solutions Architect - Associate Training (SAA-C03)

69 Cloud Lab Simulations

Certification

32-Hr Training by Dustin Brimberry

View Program
upGrad KnowledgeHut

upGrad KnowledgeHut

Angular Training

Hone Skills with Live Projects

Certification

13+ Hrs Instructor-Led Sessions

View Program
upGrad

upGrad KnowledgeHut

Full Stack Development Bootcamp - Essential

Job-Linked Program

Bootcamp

36 Weeks

View Program