XOR Checksum Calculator

XOR hex bytes to a one byte checksum with count.

Technology and NetUpdated 2026-10-161 min read
XOR Checksum Calculator
Even hex chars, 2 to 40 (1 to 20 bytes).
Checksum hex
...
Checksum decimal...
Byte count...

What it does

Checksums catch transmission slips with one byte. XOR folds every byte with exclusive or: bits differ to 1, match to 0. A flipped bit changes the fold, flagging the block.

The tool above takes even hex and returns checksum hex, decimal, and byte count. The default 48656C6C6F (Hello) matches the worked example, so the page opens showing 0x42. Type new hex to update all three results.

Folding runs left to right from zero. Here 0x48 xor 0x65 is 0x2D, xor 0x6C is 0x41, xor 0x6C is 0x2D, xor 0x6F is 0x42. Decimal 66 names the same byte. Order does not matter for XOR.

Use this for NMEA sentences, serial frames, and teaching parity. For stronger integrity use CRC or hashes. This catches odd bit flips, not all burst errors.

This page shows the method, one full hand checked example for Hello, a reference table, and practice checks that run through the tool.

How to use

  1. Type hex bytes with 0-9 and A-F.
  2. Keep length even for full bytes.
  3. Keep 1 to 20 bytes (2 to 40 chars).
  4. Read Checksum hex as two capitals.
  5. Read decimal for code use.
  6. Split longer frames into chunks.

Formula

Start 0x00, XOR each byte in turn. Result is one byte 0x00 to 0xFF.
xor
Exclusive or per bit.
byte
Two hex chars, 0 to 255.
count
Bytes folded.

Spaces and dashes strip first. Odd length or non hex stops with a message. Empty folds to 0x00 but this tool requires at least one byte.

Worked example

Example: 48 65 6C 6C 6F

XOR the Hello bytes to one checksum.

  1. Bytes: 48, 65, 6C, 6C, 6F (5 bytes).
  2. 48 xor 65 = 2D.
  3. 2D xor 6C = 41.
  4. 41 xor 6C = 2D.
  5. 2D xor 6F = 42.
  6. Hex 42 is decimal 66.

Reference table

Checks for sample hex
HexXORBytes
48656C6C6F42 (66)5 bytes
00FFFF (255)2 bytes
010203 (3)2 bytes

Limits

  • XOR only. Use CRC or hash for strong integrity.
  • 1 to 20 bytes per run here.
  • Hex only. Text needs hex encode first.
  • Detects many, not all, burst errors.

Common mistakes

  • Odd hex length with a half byte.
  • Pasting 0x prefixes that break validation. Strip them first.
  • Reading decimal 66 as hex 66.
  • Expecting order to matter for XOR.
  • Using XOR where CRC is required.

Try it yourself

Quick checks. Answers sit tucked under each question.

XOR 00FF?

Hex FF, decimal 255, 2 bytes.

XOR 0102?

Hex 03, decimal 3, 2 bytes.

Questions

Hello XOR?

0x42 (66) over 5 bytes.

Even length?

Yes. Full bytes only.

Spaces?

They strip before math.

Order?

Irrelevant for XOR.

Strong?

No. Use CRC or hash for safety.

Max?

20 bytes per run here.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.