Deciphering the Burger King Magstripe

In terms of technological innovations, magnetic stripe cards have existed for a long time, since 1960 at least. According to Wikipedia, IBM was the first company to place them on the now ubiquitous plastic cards that we all carry around in our wallets. The information on the card is encoded in three horizontal lines, running lengthwise, called tracks. Mostly only tracks 1 and 2 are used. Indeed, this is where Burger King (and all other merchants) store the data that represents a unique gift card code.

Due to magstripe technology now being so wide-spread, card reader/writer devices have drastically fallen in price. From what I understand, a decade ago writers cost $400. Today they can be found on eBay for about $70, which is where I bought mine.

This article discusses how to source cheaper electronic gift codes, decipher the Burger King magstripe, and write that code to a gift card for easier use.

Acquiring Gift Cards

Merchant gift cards can be purchased at prices below their face value due to a variety of reasons, one of which is because the funds are limited in the number of places that they can be spent — just the business issuing them. Conversely, dollars, of course, are accepted everywhere. For example, if a person receives a $200 Best Buy gift card, but has no desire to shop there, they can offer the card for sale on a website like Raise.com at a discount to the buyer.

Gift cards in the marketplace

The website hosting the listing will also take a certain percentage from the seller for facilitating the transaction, similar to eBay. Gift Card Granny is a great place to begin when shopping for gift cards, though it operates more like an index linking to several brokers including Raise, Cardpool, Cardflip, Gift Card Spread, among many others.

I recently learned that electronic gift card codes (such as Burger King) can even be sold by an official outlet for less than physical cards (as there are no shipping costs involved) and the funding and delivery is usually instant. On eBay, PayPal Digital Gifts will sometimes also discount their own stock, 16% in the case of this Domino’s gift card code.

Physical versus Electronic Gift Cards

Gift cards issued by a merchant may be in either physical or electronic form. Depending on the particular store, I have found that there are pros and cons with each format:

Pros:

  • Physical – A clerk will usually be more familiar with processing an actual gift card
  • Electronic – Can be loaded into the Raise app wallet to generate a barcode for quick scanning at the point of sale

Cons:

  • Physical – May be misplaced, demagnetized, or stolen
  • Electronic – Some merchants do not have a barcode scanner and must manually key-in the code

Burger King is one such merchant that does not offer a barcode scanner, just the traditional card swipe chip reader. (Although a barcode is present on the card itself it cannot be used.) To process a gift card it must be either swiped on the terminal or keyed-in by the cashier. As with most fast food establishments, frequent turnover results in new employees not being familiar with gift cards, and much less with how to manually enter in the gift card code. I have found it much simpler to present a physical gift card for payment rather than a 16 digit number.

Deciphering the Burger King Magstripe

Given a cheaper means of acquiring electronic merchant credit paired with the ease of use of an actual gift card, I set out to find if it were possible to write a Burger King gift code onto a magnetic card. What I discovered is that it isn’t that straightforward. My first clue came when examining the receipt after paying with one of my four physical BK gift cards. The last four digits printed on the receipt did not match any of the numbers on the card itself.

With the magnetic card reader, I was able to dump the data tracks from the card using the Windows software that came with the device. Each line represents an individual track:

%B6010564251798427^07675001646$02500$^25010005000060100558           ?
;6010564251798427=25010005000060100558?
+?

Track 3 consists of only a beginning placeholder (the plus sign) and the end sentinel (the question mark). This track is generally not used and thus contains no information; indeed a narrower magnetic strip (such as those found on most cards) physically omits the possibility of even storing data there.

Looking at the reverse side of the card, there were two numbers that were unique to each of the four cards:

  1. The 16 digit card number (6104251798420558), and
  2. An 11 digit card ID (07675001646), located in the lower right corner

After studying the data tracks and comparing with the two numbers above, the encoding began to make sense. Resources from Wikipedia’s Magnetic Stripe Card article and some wonderfully comprehensive research from the Universidad Complutense de Madrid (UCM) on the ISO 7813 specification were essential to my understanding the format of the raw data and accurately deducing and labeling each piece. Notice how tracks 1 and 2 store similar information, though track 2 does not contain the lower right corner card ID number.

Here is the table I used to organize the breakdown. The two numbers sourced from the actual card examined are represented in bold:

Value Definition Notes
TRACK 1 IATA format: Up to 79 ALPHA 7-bit (including parity) characters (alphanumeric)
%B6010564251798427^
07675001646$02500$^
25010005000060100558 ?
Raw data, parsed below Also shown in above track data
% Start Sentinel (SS). then follows Primary Account Number (PAN): Up to 19 digits
B Format Code (FC): Bank/financial Several codes available, see UCM resource
6 Major Industry Identifier (MII): Merchandising and banking
01056 Issuer Identifier (II) Same for all four BK cards
425179842 Individual Account Identification (IAI) Digits 4 through 12 of the card number
7 Check Digit (CD) The Luhn checksum of the first 15 digits (ex 601056425179842)
^ Field Separator (FS). then follows Name (NM): 2-26 characters
07675001646 Physical card ID number with a leading zero, lower right corner
$02500$ Maybe the initial load sum of $25. Has no bearing on card use
^ Field Separator (FS)
2501 Expiry Date (ED): 4 digits in the form YYMM. then follows Service Code (SC): 3 digits Similar to One Vanilla Gift Cards
0 Digit 1 – Interchange and technology: Reserved for future use by ISO Several codes available, see UCM resource
0 Digit 2 – Authorization processing: Transactions are authorized following the normal rules Several codes available, see UCM resource
0 Digit 3 – Range of services and PIN requirements: No restrictions and PIN required Several codes available, see UCM resource
50000 Offset or PIN Verification Value (PVV): 5 digits Switches between 4 or 5 with trailing zeros depending on the lower right card ID number on the four test cards
6 begin Discretionary Data (DD): Remainder of characters First card number digit
0 Static 0 value seems always to be set
10 Second and third card number digits
0558 Last four card number digits
? End Sentinel (ES)
TRACK 2 ABA format: Up to 40 BCD 5-bit (including parity) characters (numeric)
;6010564251798427=
25010005000060100558?
Raw data, parsed below Also shown in above track data
; Start Sentinel (SS). then follows Primary Account Number (PAN): Up to 19 digits
6 Major Industry Identifier (MII): Merchandising and banking
01056 Issuer Identifier (II) Same for all four BK cards
425179842 Individual Account Identification (IAI) Digits 4 through 12 of the card number
7 Check Digit (CD) The Luhn checksum of the first 15 digits (ex 601056425179842)
= Field Separator (FS)
2501 Expiry Date (ED): 4 digits in the form YYMM. then follows Service Code (SC): 3 digits Similar to One Vanilla Gift Cards
0 Digit 1 – Interchange and technology: Reserved for future use by ISO Several codes available, see UCM resource
0 Digit 2 – Authorization processing: Transactions are authorized following the normal rules Several codes available, see UCM resource
0 Digit 3 – Range of services and PIN requirements: No restrictions and PIN required Several codes available, see UCM resource
50000 Offset or PIN Verification Value (PVV): 5 digits Switches between 4 or 5 with trailing zeros depending on the lower right card ID number on the four test cards
6 begin Discretionary Data (DD): Remainder of characters First card number digit
0 Static 0 value seems always to be set
10 Second and third card number digits
0558 Last four card number digits
? End Sentinel (ES)
TRACK 3 THRIFT-TTS format: Up to 107 BCD 5-bit (including parity) characters (numeric)
+? End Sentinel (ES) No data read from card besides this and the end sentinel

Observations

The last four numbers shown on my receipt (8427) mapped back to the values in places 10, 11, and 12 of the original 16 digit card number, followed by the computed Luhn checksum.

The 11 digit physical card ID number along with its corresponding PIN value (5 in this case) is in no way associated with the 16 digit card number. This makes sense as equivalent 16 digit electronic gift codes can be entered by the cashier manually without presenting a physical gift card.

In my tests, the Burger King point of sale system expected the correct PIN and would not process the card if the value were any different. It remains unknown to me how the PIN value is computed from a given card ID number.

Writing a New Burger King Gift Card

These are the Excel formulas I developed to generate track data that is understood by the magnetic card reader software for writing data tracks back to the card. (Any card with a magnetic stripe will work, even a credit card.)

Note that the electronic gift card code is referenced as cell A52:

Track 1:

="%B601056"&MID(A52,4,9)&(10-MOD(SUMPRODUCT(-MID(TEXT(MID(("601056"&MID(A52,4,9)),ROW(INDIRECT("1:"&LEN(("601056"&MID(A52,4,9))))),1)*(MOD(ROW(INDIRECT("1:"&LEN(("601056"&MID(A52,4,9)))))+LEN(("601056"&MID(A52,4,9)))+1,2)+1),"00"),{1,2},1)),10))&"^07675001646$00000$^250100050000"&LEFT(A52,1)&"0"&MID(A52,2,2)&RIGHT(A52,4)&"           ?"

Track 2:

=";601056"&MID(A52,4,9)&(10-MOD(SUMPRODUCT(-MID(TEXT(MID(("601056"&MID(A52,4,9)),ROW(INDIRECT("1:"&LEN(("601056"&MID(A52,4,9))))),1)*(MOD(ROW(INDIRECT("1:"&LEN(("601056"&MID(A52,4,9)))))+LEN(("601056"&MID(A52,4,9)))+1,2)+1),"00"),{1,2},1)),10))&"=250100050000"&LEFT(A52,1)&"0"&MID(A52,2,2)&RIGHT(A52,4)&"?"

By using these formulas it is easy to generate correctly computed and accurately formatted track data that is accepted by the Burger King point of sale system.

Resources and References

Leave a Reply

Your email address will not be published. Required fields are marked *