Xerobit

Checksum Calculator for Text and Hex Data

Enter text or hex bytes to compute Sum8, XOR8, Fletcher-16 and Internet checksums instantly. This checksum calculator processes everything locally in your browser so no data is uploaded. Use it to verify serial commands, network packets or file integrity with lightweight error-detecting codes.

Type plain text or hex bytes (e.g. 48 65 6C 6C 6F or 48656C6C6F).

Result

  • Sum8
    0xF4
  • XOR8
    0x42
  • Fletcher-16
    0x8CF5
  • Internet Checksum
    0xDC2D
  • Input read as
    Text (UTF-8)
  • Bytes processed
    5

How to use the checksum calculator

  1. Enter your data as plain text or hex bytes separated by spaces.
  2. Select the input format or leave it on Auto-detect to let the tool decide.
  3. Read the computed Sum8, XOR8, Fletcher-16 and Internet checksum values below.
  4. Use the results to verify serial protocols, network headers or simple file checks.

How each checksum algorithm works

A checksum calculator applies a deterministic formula to a sequence of bytes and produces a short fixed-size value. Here is how the four algorithms work.

Sum8 adds every byte together and keeps only the lowest 8 bits. For the text "Hi" (bytes 0x48 and 0x69): (0x48 + 0x69) mod 256 = 0xB1.

XOR8 applies the bitwise exclusive-or operation across all bytes. For "Hi": 0x48 XOR 0x69 = 0x21.

Fletcher-16 maintains two running sums. The first sum accumulates each byte modulo 255. The second sum accumulates the first sum modulo 255. The final result places sum2 in the high byte and sum1 in the low byte. For bytes 0x01 and 0x02: after byte 1, s1=1, s2=1; after byte 2, s1=3, s2=4. Result: 0x0403.

Internet Checksum (RFC 1071) groups bytes into 16-bit words in big-endian order, sums them using one's complement arithmetic, folds any carry bits back into the lower 16 bits, and finally inverts all bits. If the data has an odd number of bytes, a zero byte is padded at the end.

Reference table for common inputs

The following table shows expected outputs from this checksum calculator for a few standard test strings. You can use these values to validate your own implementations.

InputBytes (hex)Sum8XOR8Fletcher-16
A410x410x410x4141
Hi48 690xB10x210xF9B1
12345678931 32 ... 390xDD0x310x1EDE

These values are computed over the UTF-8 byte representation of each string. Changing the encoding changes the resulting checksums.

When to use simple checksums versus cryptographic hashes

Simple checksums like Sum8 and Fletcher-16 are designed for detecting accidental errors such as bit flips during transmission or storage corruption. They are extremely fast and require minimal computation, which makes them ideal for embedded systems, serial protocols like NMEA sentences in GPS devices, and basic file verification where security is not a concern.

Cryptographic hash functions serve a different purpose. If you need tamper resistance or digital signatures, use a dedicated tool like the SHA-256 hash generator or MD5 hash generator. Those algorithms resist intentional collision attacks, whereas a checksum calculator does not. An attacker can easily craft different data that produces the same Sum8 or XOR8 value.

For verifying structured identifiers rather than raw byte streams, consider tools like the GTIN validator or VIN decoder, which implement domain-specific check digit algorithms.

Common mistakes when computing checksums

Several pitfalls cause incorrect results when working with checksums manually or in code.

  • Confusing text with hex: Typing "AB" as text yields bytes 0x41 and 0x42. Typing "AB" as hex yields a single byte 0xAB. Always specify the input mode explicitly if your data contains valid hex characters.
  • Byte order in Internet Checksum: RFC 1071 specifies big-endian (network) byte order. Pairing bytes incorrectly reverses the 16-bit words and produces a wrong result.
  • Odd-length padding: The Internet checksum pads an odd number of bytes with a trailing zero. Forgetting this step shifts the final inverted sum.
  • Modulo 255 vs 256: Fletcher-16 uses modulo 255 for its accumulators, not modulo 256. Using 256 produces a different algorithm entirely.

Background on error-detecting codes

Checksums belong to a family of error-detecting codes used throughout computing history. The simplest form, a parity bit, detects single-bit errors but fails on double-bit flips. Sum8 improves on parity by catching more multi-bit errors, though it cannot detect byte reordering. XOR8 shares similar limitations.

Fletcher-16 was designed by John G. Fletcher at Lawrence Livermore National Laboratory in the 1970s. It approaches the error-detection capability of a cyclic redundancy check while remaining much cheaper to compute in software. For stronger polynomial-based detection, see the CRC calculator.

The Internet checksum defined in RFC 1071 underpins TCP, UDP and IP header validation. Its one's complement arithmetic ensures that the checksum field itself can be included in the calculation without altering the result, a property that simplifies hardware forwarding in routers.

Worked examples

ExampleInputResult
Text: HelloInput data: Hello; Input format: textSum8: 0xF4; XOR8: 0x42; Fletcher-16: 0x8CF5; Internet Checksum: 0xDC2D; Input read as: Text (UTF-8); Bytes processed: 5
Hex: 01 02 03 04Input data: 01 02 03 04; Input format: hexSum8: 0x0A; XOR8: 0x04; Fletcher-16: 0x140A; Internet Checksum: 0xFBF9; Input read as: Hex bytes; Bytes processed: 4
Text: ChecksumInput data: Checksum; Input format: textSum8: 0x33; XOR8: 0x2D; Fletcher-16: 0xA636; Internet Checksum: 0x7653; Input read as: Text (UTF-8); Bytes processed: 8
Hex: DEADBEEFInput data: DEADBEEF; Input format: hexSum8: 0x38; XOR8: 0x22; Fletcher-16: 0xF13B; Internet Checksum: 0x6262; Input read as: Hex bytes; Bytes processed: 4

FAQ

What is a checksum calculator used for?

It computes short error-detecting values from a sequence of bytes. Engineers use these values to verify that data sent over serial ports, networks or stored in files has not been corrupted by accidental bit flips.

What is the difference between Sum8 and XOR8?

Sum8 adds all bytes together and keeps the lowest 8 bits, while XOR8 combines all bytes using the bitwise exclusive-or operation. Sum8 is slightly better at detecting certain multi-bit errors, but neither detects byte reordering.

Why does Fletcher-16 use modulo 255 instead of 256?

With modulo 256, the high bits of each byte would only ever reach the low byte of the result and the second sum would add little. Modulo 255 (one less than the 8-bit range) lets carries wrap around, so both sums depend on every bit. The trade-off is that a 0x00 byte and a 0xFF byte look the same to Fletcher-16.

Can I use this checksum calculator for passwords or security?

No. Simple checksums are designed to catch accidental errors, not malicious tampering. For security purposes, use cryptographic hash functions like SHA-256 instead.

How does auto-detect choose between text and hex?

If the input consists solely of hexadecimal characters (0-9, A-F) and optional spaces, with an even number of digits, the tool treats it as hex bytes. A row in the results shows which reading was used. Otherwise it encodes the input as UTF-8 text bytes.

Is my data sent to a server?

No. All calculations run locally in your browser. Nothing is uploaded anywhere.