Log in

FIX TagValue Encoding

FIX TagValue encoding was the original encoding within FIX, and is still the most commonly used encoding today. It's a way of converting messages into a series of bytes to be sent over TCP or another transport.

In the TagValue encoding, fields are encoded as a "tag", followed by =, followed by the value of that field. The tag is an integer which represents a unique field ID. For example, the tag 35 represents the MsgType field, the type of the message. The tag-to-field mapping is typically encoded in a FIX dictionary used by both parties.

Fields are delimited by the Start of Heading control character ("SOH"). Since SOH is non-printable, it may sometimes be displayed as a white square . It's commonly replaced with a pipe character | for human-readability.

35=A
Hover for explanation

Tags, values and delimiters are all encoded with the single-byte encoding ISO-8859-1. That is, a decimal tag 35 is encoded as the character '3' followed by the character '5', and not the decimal 35.

Both tag and value must contain at least 1 character.

Repeating groups

Certain messages may need to represent an array of records, e.g. a list of securities or a list of trades. The TagValue encoding achieves this by preceding the group elements with a field which specifies the number of elements to follow, called a NumInGroup field. Each element then begins with the same mandatory data field, which also acts as the delimiter between elements, to allow a FIX engine to delineate between elements.

There is no terminator for the final group element. Instead, FIX engines can infer when the final group element has ended by awaiting the first field which does not appear in the group element's definition in the FIX dictionary.

146=255=APPL44=16855=AMZN44=185
Hover for explanation

Binary data

It may be the case that a field value is designed to carry arbitrary binary data. In such cases, the data may happen to contain a SOH character, which would terminate the value early and lead to incorrect parsing of the message. To solve this problem, binary data fields are preceded by a companion field which specifies the length in bytes of the subsequent data. FIX engines can then read the given number of bytes and treat any SOH characters encountered as data, and not as a field delimiter.

95=396=A␁B
Hover for explanation

For a fully comprehensive explanation, read the full technical standard for FIX TagValue encoding.