16 Internet Checksum Utility

Internet Protocol Checksum Calculator

Use this Internet Protocol Checksum Calculator to calculate the standard 16-bit one’s-complement checksum used by IPv4, TCP, UDP, and other Internet protocol data. Enter hexadecimal bytes to see the checksum, one’s-complement sum, word count, padding, and verification value.

✓ 16-Bit Internet Checksum ✓ IPv4 Header ✓ TCP / UDP Data ✓ Word Breakdown ✓ Checksum Verification
IP
Calculate Internet Checksum
● Ready
Generate complements the final sum. Verify checks whether the full data sums to 0xFFFF.
Hex bytes may contain spaces, colons, dashes, or line breaks.
For IPv4 checksum generation, the header checksum field should be set to 00 00 before calculation.
Internet Checksum Result Calculated
Checksum
One’s-Complement Sum
16-Bit Words
Input Bytes
Padding
16-Bit Word Breakdown -
Verification Result -

What Is an Internet Protocol Checksum?

The Internet checksum is a 16-bit error-detection value used by several Internet protocols. It is based on one’s-complement addition rather than a polynomial CRC.

RFC 1071 defines the Internet checksum by grouping adjacent octets into 16-bit integers, adding those words using one’s-complement arithmetic, and taking the one’s complement of the resulting 16-bit sum when generating the checksum. :contentReference[oaicite:1]{index=1}

The same checksum family is used by IPv4 header checksums and in TCP and UDP checksum calculations, although TCP and UDP also include protocol-specific pseudo-header data in their complete checksum coverage.

How to Use the Internet Checksum Calculator

Select Generate or Verify

Choose Generate Checksum when creating a new checksum, or Verify Existing Checksum when the supplied data already contains the checksum value.

Select the input format

Use Hexadecimal Bytes for packet captures or 16-Bit Hex Words when you already have grouped protocol words.

Enter the protocol data

For a new IPv4 header checksum, place 0000 in the header checksum field before calculating.

Calculate the one’s-complement sum

The tool groups bytes into 16-bit words and repeatedly folds end-around carry bits back into the low 16 bits.

Read the checksum

Generation mode complements the final sum to produce the transmitted checksum.

How the Internet Checksum Is Calculated

Adjacent bytes are interpreted as 16-bit words in network order. Those words are added using one’s-complement arithmetic. Any carry above bit 15 is added back into the low 16-bit result.

Example words: 0001 F203 F4F5 F6F7 Normal sum with end-around carry: 0xDDF2 One’s complement: 0x220D

RFC 1071 gives the intermediate one’s-complement sum of this example as 0xDDF2. Complementing that value gives checksum 0x220D. :contentReference[oaicite:2]{index=2}

IPv4 Header Checksum Calculation

IPv4 includes a 16-bit Header Checksum field. RFC 791 specifies that this checksum covers the IPv4 header only, not the payload. Before calculating a new checksum, the checksum field itself is treated as zero. :contentReference[oaicite:3]{index=3}

IPv4 header with checksum cleared: 45 00 00 3C 1C 46 40 00 40 06 00 00 AC 10 0A 63 AC 10 0A 0C The bytes: 00 00 occupy the checksum field during generation.

Because fields such as Time To Live can change while a packet is forwarded, the IPv4 header checksum must be updated when relevant header data changes. RFC 791 explicitly notes that the header checksum is recomputed and verified as the header is processed. :contentReference[oaicite:4]{index=4}

Generate Checksum vs Verify Checksum

Generate Mode

Add all applicable 16-bit words using one’s-complement arithmetic, then invert all 16 bits of the final sum.

Verify Mode

Include the transmitted checksum in the data. A correct complete one’s-complement sum produces 0xFFFF.

RFC 1071 describes checksum verification by summing the same set of octets including the checksum field. A valid result is all one bits in one’s-complement arithmetic. :contentReference[oaicite:5]{index=5}

Why Is End-Around Carry Required?

Ordinary binary addition discards a carry that exceeds the chosen word size. One’s-complement addition instead wraps that carry around and adds it back to the low-order bits.

If an intermediate sum is: 0x1DDF1 split it into: Low 16 bits = 0xDDF1 Carry = 0x0001 Then: 0xDDF1 + 0x0001 = 0xDDF2

This end-around carry behavior is fundamental to the Internet checksum and distinguishes it from ordinary unsigned addition.

What Happens with an Odd Number of Bytes?

The checksum operates on 16-bit words, so an odd number of input octets leaves one final unmatched byte.

For calculation purposes, that last byte is paired with a zero byte to form the final 16-bit word. The calculator reports when this zero padding was required.

The zero used for checksum arithmetic is padding for the calculation. It does not necessarily mean an extra byte is transmitted as part of the protocol data.

Internet Checksum vs CRC

The Internet checksum is not a cyclic redundancy check. CRC algorithms use polynomial division, while the Internet checksum uses one’s-complement addition of 16-bit words.

The two mechanisms therefore have different mathematical properties and must not be substituted for each other simply because both are used for error detection.

IPv4 Checksum vs TCP and UDP Checksums

Protocol Checksum Coverage Important Detail
IPv4 IPv4 header only The IPv4 checksum field is zeroed during generation.
TCP Pseudo-header + TCP header + TCP data The pseudo-header contributes IP addressing and protocol information.
UDP Pseudo-header + UDP header + UDP data Full checksum calculation requires the protocol pseudo-header.
Raw data User-supplied bytes The same 16-bit one’s-complement arithmetic can be calculated directly.

RFC 1071 specifically discusses the Internet checksum as used by IP, UDP, and TCP. :contentReference[oaicite:6]{index=6}

Why TCP and UDP Need a Pseudo-Header

A TCP or UDP checksum is not calculated over the transport segment alone. Protocol checksum construction also incorporates selected network-layer information through a pseudo-header.

That means simply pasting a TCP or UDP header into a generic Internet checksum calculator does not produce the complete wire checksum unless the required pseudo-header and payload bytes have also been included.

Use this page for the core one’s-complement checksum operation. When constructing a full TCP or UDP checksum, assemble the correct pseudo-header, transport header, and payload first.

Internet Checksum Worked Example

Input: 0001 F203 F4F5 F6F7 Step 1: 0001 + F203 = F204 Step 2: F204 + F4F5 = 1E6F9 Apply end-around carry: E6F9 + 0001 = E6FA Step 3: E6FA + F6F7 = 1DDF1 Apply end-around carry: DDF1 + 0001 = DDF2 Final one’s complement: ~DDF2 = 220D

This matches the numerical example described in RFC 1071. :contentReference[oaicite:7]{index=7}

Common Internet Checksum Mistakes

Using Ordinary Addition

Carries must be wrapped around into the lower 16 bits rather than discarded.

Wrong Byte Pairing

Adjacent bytes must be grouped consistently into 16-bit words.

Not Clearing the IPv4 Field

When generating an IPv4 header checksum, the checksum field must be zero during the calculation.

Forgetting Odd-Byte Padding

A final unpaired byte requires a zero byte for checksum arithmetic.

Omitting the TCP/UDP Pseudo-Header

A complete TCP or UDP checksum needs more than just the transport header.

Confusing Checksum with CRC

The Internet checksum uses one’s-complement arithmetic, not polynomial CRC division.

Internet Protocol Checksum Calculator FAQs

What is the Internet checksum?
It is a 16-bit one’s-complement checksum formed by adding 16-bit words with end-around carry and complementing the resulting sum.
Which protocols use the Internet checksum?
The Internet checksum algorithm is associated with IPv4, TCP, UDP, and related Internet protocol processing.
How is the IPv4 header checksum calculated?
Set the IPv4 header checksum field to zero, add all 16-bit header words using one’s-complement arithmetic, then complement the final 16-bit sum.
Does the IPv4 checksum include payload data?
No. The IPv4 Header Checksum covers the IPv4 header only.
What is one’s-complement addition?
It is addition in which a carry beyond the most significant bit is wrapped around and added back into the low-order result.
What does a valid checksum verify to?
When the original checksum is included in the data, the complete one’s-complement sum should equal 0xFFFF.
What if the data has an odd number of bytes?
The final byte is paired with a zero byte for checksum arithmetic.
Is the Internet checksum the same as CRC-16?
No. CRC-16 uses polynomial arithmetic, while the Internet checksum uses one’s-complement addition.
Does TCP use the same checksum algorithm?
TCP uses the Internet checksum arithmetic, but its complete checksum also includes a pseudo-header and the TCP segment data.
Does UDP use the same checksum algorithm?
Yes, but the complete UDP checksum also incorporates a pseudo-header along with the UDP header and payload.
Why must the IPv4 checksum be recalculated?
Some IPv4 header fields can change while the packet is forwarded, so the header checksum must reflect the current header contents.
Can I enter spaced hexadecimal bytes?
Yes. The calculator accepts common separators such as spaces, colons, dashes, and line breaks.
Can I enter 16-bit words directly?
Yes. Select 16-Bit Hex Words and enter four-digit hexadecimal words such as 0001 F203 F4F5 F6F7.
What is the checksum of 0001 F203 F4F5 F6F7?
The one’s-complement sum is 0xDDF2 and the resulting checksum is 0x220D.
Does this calculator require PHP processing?
No calculation is performed on the server. The separate WordPress PHP snippet only injects the browser JavaScript used by the page.

Calculate Internet Checksums Instantly

Enter IPv4 header bytes, TCP/UDP checksum data, or arbitrary hexadecimal protocol words to calculate the standard 16-bit one’s-complement checksum, inspect the intermediate sum, and verify existing checksum values.

Scroll to Top