← Technical Guides

Verify a FIX checksum by hand

Follow a complete Heartbeat from BeginString to CheckSum and reproduce the three-digit trailer from the bytes on the wire.

The last field of a tag-value message carries an eight-bit checksum written as three decimal digits. Add the unsigned values of the bytes from the first 8 in BeginString through the SOH immediately before 10=. Divide by 256 and keep the remainder. The checksum field and its own trailing SOH sit outside that range. FIX TagValue Encoding Standard

A 65-byte calculation

In this synthetic Heartbeat, each vertical bar represents one SOH byte (0x01). The raw message has a final SOH after 022.

8=FIX.4.4|9=50|35=0|49=LAB_A|56=LAB_B|34=17|52=20260115-09:30:00|10=022|

The prefix before 10= is 65 bytes long. As a spot check, the field 35=0| contributes 51 + 53 + 61 + 48 + 1 = 214. Its final byte contributes one, even though the printed pipe character has a value of 124. The full prefix sums to 3,350. Subtract thirteen multiples of 256 and the remainder is 22. Left-padding that value produces 10=022.

Change only the sequence number from 17 to 18. The BodyLength stays at 50 because the new digits occupy the same space. The byte sum rises by one, so this copy needs 10=023. A validator should flag the original trailer if it still says 022.

Isolating a discrepancy

A result of 115 for the original example points to one specific mistake. Summing all seven printed pipes as literal bytes adds 7 × (124 − 1) to the prefix. Other discrepancies can come from a logger adding a timestamp, redacting a value or decoding binary data to text. Consult the capture format before interpreting display delimiters in a field that might itself contain a pipe.

A passing checksum alone says little about field order. Swapping two entire fields keeps the same byte sum. Check the envelope, the dictionary for the selected message, and the declared body span as independent checks. Counting BodyLength