Track 2 Data
What it is
Magnetic-stripe Track 2: PAN, separator, expiry, service code, and discretionary data (PVV/CVC1).
Track 2 carries PAN=expiry+service code+discretionary data in the ISO 7813 code set, with "=" (encoded D) as separator. Chip transactions send the Track 2 Equivalent Data from EMV tag 57 here; contactless magstripe-mode sends dynamic CVC3 data in the discretionary field.
Like DE 2 this is cardholder data under PCI DSS — mask it in logs. The service code inside it (3 digits) tells the terminal and issuer how the card may be used; decode it with the service-code tool.
Example values
4761739001010119=28122011143857589PAN = expiry 2812, service code 201, discretionary data.DE 35 on the wire
Bitmap position
DE 35 is bit 35 of the primary bitmap: byte 5, mask 0x20. A primary bitmap with only DE 35 present reads 0000000020000000 in hex.
Length
DE 35 is variable length (LLVAR): a 2-digit prefix gives the length of the value in characters, from 0 to 37. A 12-character value is sent as 12 followed by the value. In ASCII the prefix is the bytes 31 32; dialects that pack lengths as BCD send 12 instead.
Size in the message
At most 39 bytes when the message travels as text (ASCII or EBCDIC), or 20 bytes in binary dialects that pack digits as BCD.
Format z
Format z means the track 2 code set: digits plus the field separator (= on the stripe, D in chip data).
Specification reference
Defined in ISO 8583:1987 (base). Card networks publish their own dialect tables (Visa BASE I / V.I.P., Mastercard CIS) that refine formats, lengths, and — for private-use elements — the entire layout. Always confirm against the interface specification you implement.