---
title: "Appendix B: CheckSum Calculation – FIX 4.0 – FIX Dictionary – Onix Solutions"
description: "Appendix B: CheckSum Calculation – FIX 4.0 – FIX Dictionary – Onix Solutions"
---

<https://www.onixs.biz/fix-dictionary/4.0/app_b.html#>

![Dictionary icon](https://www.onixs.biz/hubfs/SIC_website_2020/images/interface/img-icon-book.svg)

# Appendix B: CheckSum Calculation – FIX 4.0 – FIX Dictionary

| Messages by MsgType \| Messages by Name \| Fields by Tag \| Fields by Name \| FIX 4.0 \| Home Appendix B CheckSum Calculation The checksum of a FIX message is calculated by summing every byte of the message up to but not including the checksum field itself. This checksum is then transformed into a modulo 256 number for transmission and comparison. The checksum is calculated after all encryption is completed, i.e. the message as transmitted between parties is processed. For transmission, the checksum must be sent as printable characters, so the checksum is transformed into three ASCII digits. For example, if the checksum has been calculated to be 274 then the modulo 256 value is 22. This value would be transmitted a \|10=022\| where "10="is the tag for the checksum field. A sample code fragment to generate the checksum field is as follows: char *GenerateCheckSum( char *buf, long bufLen ) { static char tmpBuf[ 4 ]; long idx; unsigned int cks; for( idx = 0L, cks = 0; idx < bufLen; cks += (unsigned int)buf[ idx++ ] ); sprintf( tmpBuf, "%03d", (unsigned int)( cks % 256 ) ); return( tmpBuf ); } |
| --- |
| ![](https://www.onixs.biz/hs-fs/hubfs/fix-dictionary/img/spacer.gif?height=5&name=spacer.gif) |

- Follow   
  OnixS
- [Follow us on Twitter ](https://twitter.com/onixsbiz)
- [Connect with us on LinkedIn ](https://www.linkedin.com/company/onix-solutions/)

 We track how people interact with our online web content and resources, and some of that tracking involves storing cookies on your device. By continuing to use our site you accept that you agree to this. For more details see our [Cookie usage, and Data Privacy and Protection Policies](https://www.onixs.biz/cookies-and-privacy.html).

[Ok](https://www.onixs.biz/fix-dictionary/4.0/app_b.html#)

[OnixS ](https://www.onixs.biz/)

Menu

---

---

[OnixS ](https://www.onixs.biz/)

### Search the site

Search