Internet Checksum Calculator

Enter hexadecimal data to compute its RFC 1071 Internet checksum.

How it is calculated

Paste your data as hexadecimal digits; spaces and upper or lower case are ignored, but anything that is not 0-9 or a-f (including a 0x prefix) makes the tool return nothing. The digits are cut into 16-bit words of four hex digits. They are added together, and every carry out of bit 16 is folded back into the low 16 bits: sum = (sum & 0xFFFF) + (sum >> 16), repeated until nothing is left over. The checksum is the bitwise complement of that sum, ~sum & 0xFFFF, printed as four hex digits with a 0x prefix. If the data ends in an incomplete word it is padded with zeros on the right, so the single byte ab is treated as ab00. To generate a header checksum, set the checksum field to 0000 first.

Worked example

An IPv4 header with its checksum field set to 0000: 4500 0073 0000 4000 4011 0000 c0a8 0001 c0a8 00c7. Adding the ten words gives 0x2479C; the carry above 16 bits (0x2) is folded back into the low part: 0x479C + 0x2 = 0x479E. The one's complement of 0x479E is 0xB861, so the checksum is 0xB861. Put B861 into the checksum field and recompute: the result is 0x0000, which is how a receiver verifies a good header.

Try this example →

Common mistakes

  • Forgetting to zero the checksum field before generating. With the old value left in, the sum is wrong and you get a different number (a header that already contains a valid checksum yields 0x0000).
  • Including a 0x prefix or separators like colons or commas. Only hex digits and whitespace are accepted.
  • Entering decimal or ASCII text. The tool reads every character as a hex digit, so "1500" means bytes 15 00, not the number fifteen hundred.
  • Dropping a leading zero in a byte. "4 5 00" collapses to 4500 after whitespace is removed, but "500" is padded on the right to 5000, a different value.
  • Expecting a hash. The Internet checksum only catches accidental corruption; it is trivially forged and is not a security check.

About this calculator

This calculator computes the Internet checksum defined in RFC 1071: split the data into 16-bit words, sum them using one's-complement arithmetic (any carry out of the top bit wraps back into the sum), then take the one's complement of the final result. It's a lightweight error-detection code, not a cryptographic hash.

This exact algorithm is what protects the header of every IPv4, TCP and UDP packet on the internet — the receiving side recomputes the checksum and drops the packet if it doesn't match, catching transmission errors introduced anywhere along the path.

Was this helpful?

You can pick up to 3 reactions.

Comments

  • Be the first to comment.

Popular calculators

All Calculators