• Main Menu
  • Data Layout on Magnetic Stripe Cards


    Data is laid out on a standard magnetic card in three tracks. A magnetic stripe card may have any of these tracks or a combination of these tracks.

    Track 1 was the first track standardized. The International Air Transportation Association (IATA) developed it and it is still reserved for their use. It is 210bpi with room for 79 7-bit characters.

    Track 1 is encoded with a 7-bit scheme (6 data bits plus one parity bit) that is based on ASCII. If the reader does not perform the ASCII conversion, add 0x20 to each byte to turn it into ASCII (there are no “control” characters). The seventh bit is an odd parity bit at the end of each byte.

    Track 1 Fields

    Start sentinel 1 byte (the % character)
    Format code 1 byte alpha (The standard for financial institutions specifies format code is “B”)
    Primary Account number Up to 19 characters. American Express inserts space characters in here in the same places the digits are broken up on the face of the card.
    Separator 1 byte (the ^ character)
    Country code 3 bytes, if used. (The United States is 840) This is only used if the account number begins with “59.”
    Surname
    Surname separator (the / character)
    First name or initial
    Space (when followed by more data)
    Middle name or initial
    Period (when followed by a title)
    Title (when used)
    Separator 1 byte (^)
    Expiration date or separator 4 bytes (YYMM) or the one byte separator if a non-expiring card.
    Discretionary data Optional data can be encoded here by the issuer.
    End Sentinel 1 byte (the ? character)
    Longitudinal Redundancy Check (LRC) 1 byte. The LRC is made up of parity bits for each “row” of bytes, making the total even. That means that the total of all the bit 1s of each byte has to come out to an even number. Same for bit 2, etc. The LRC’s parity bit is not the sum of the parity bits of the message, but only the parity bit for the LRC character itself. (It is odd, just like any other single byte’s parity bit).

    The American Bankers Association (ABA) developed track 2 for online financial transactions. It is 75bpi with room for 40 5-bit numeric characters.

    Track 2 is encoded with a 5-bit scheme (4 data bits plus one parity bit). To convert this data into ASCII, add 0x30 to each byte.

    Track 2 Fields

    Start sentinel 1 byte (0x0B, or a ; in ASCII)
    Primary Account Number Up to 19 bytes
    Separator 1 byte (0x0D, or an = in ASCII)
    Country code 3 bytes, if used. (The United States is 840) This is only used if the account number begins with “59.”
    Expiration date or separator 4 bytes (YYMM) or the one byte separator if a non-expiring card
    Discretionary data The issuer can encode optional data here.
    End Sentinel 1 byte (0x0F, or a ? in ASCII)
    Longitudinal Redundancy Check (LRC) 1 byte.

    Track 3 is also used for financial transactions. The difference is its read/write ability. It is 210bpi with room for 107 numeric digits. Track 3 is used to store the enciphered PIN, country code, currency units, amount authorized, subsidiary account information, and other account restrictions.

    Track 3 has the same properties as track 1 (start and end sentinels and an LRC byte), except that there is no standard for the data content or format. No national bank card issuer currently issues track 3.

    In those rare systems where the PIN is stored on the card, this is the track where it is stored.

    Additional Reading on Magnetic Cards

    For more information on this topic, read the ANSI/ISO 7811/1-5 standard. This document can be obtained from the American Bankers Association.

    Other standard documents covering related topics include:

    • ANSI X3.92 Data Encryption Algorithm (DEA)
    • ANSI X3.106 Modems of DEA Operation
    • ANSI X4.16 American National Standard for financial services, financial transaction cards, magnetic stripe encoding
    • ANSI X9.8 Personal Identification Number (PIN) Management and Security
    • ANSI X9.19 Financial Institution Retail Message Authentication (MAC)
    • ISO 7810
    • ISO 7811
    • ISO 7812
    • ISO 8583 Bank card originated messages; Interchange message specifications; Content for financial transactions.
    • ISO 8731-1 Banking: Approved algorithms for message authentication

      Part 1 – DEA
      Part 2 – Message Authentication algorithms

    • ISO 7816 Identification cards, Integrated circuit(s) with contacts

      Part 1 – Physical Characteristics
      Part 2 – Dimensions and locations of the contacts
      Part 3 – Electronic signals and transmission protocols

    Got Something To Say:

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

    10 comments
    1. B

      17 January, 2019 at 9:20 am

      If you want to read track 3 on a financial card set your reader to read raw data on the card and swipe it. That will show you more than the “no data” message you usually get. Otherwise I haven’t a clue as to how to decode what you may or may not find there.

      Reply
    2. Jesse Pisors

      2 June, 2017 at 1:28 pm

      Here’s what I’m wondering: Does Track 3 actually store the card holder’s CC billing address? The fact that part or all of the billing address is often requested to verify identity and authorize a transaction makes me think that the whole address might be stored on this track. What about the full name of the CC holder? Open to any insights. Thanks!

      Reply
      • Mike Powlas

        25 May, 2018 at 12:38 am

        All I have seen on track 3 is nothing on visa/master cards. Not tried any other cards.

        Reply
    3. Seemore Butts

      9 April, 2016 at 7:26 am

      WHTS THE PIN NUMBER ON TRACK 3

      Reply
    4. taylor

      17 September, 2015 at 11:50 pm

      Hi guys, who could help on how generate Amex track1 with track2.. thanks

      Reply
    5. Gregory Morales

      13 September, 2015 at 7:10 am

      wat is the last three numbers on track 2

      Reply
    6. greg

      20 June, 2014 at 4:54 pm

      I am looking for the iso measurement for the start sentinel on a track 2 encoding?

      Reply
    7. selvol

      8 June, 2014 at 1:59 am

      Correction, Here is Track 3 From an UPSIDE Prepaid VISA.
      +1200907360011?

      Reply
    8. sri

      23 January, 2013 at 6:35 pm

      thanks for all the details about track data. i have a query – Based on what is stated below, which account number starts with 59 ?? as some customer names would have country code before the name, it would be good to know the account numbers for which country code is also included.

      Country code – 3 bytes, if used. (The United States is 840) This is only used if the account number begins with “59.”

      Reply
    9. Debbie

      8 September, 2011 at 5:29 pm

      Does the above encoding spec comply with China standard encoding spec for mag stripe data?

      Reply
    Smart Cards
    176 queries in 0.535 seconds.