2ClickKit

Magnetic Stripe Track 1 Decoder

Files Never Leave Your Device

Parse ISO/IEC 7813 Track 1 magstripe data: Start Sentinel %, Format Code B, PAN, Name, Expiration, 3-digit Service Code, and LRC parity locally.

Magnetic Stripe Track 1 Decoder (ISO/IEC 7813)

Deconstruct 210 BPI alphanumeric Track 1 magstripe data: Start Sentinel %, Format Code B, PAN, Cardholder Name, Expiration, Service Code, Discretionary Data, and LRC checksum with 100% in-browser privacy.

Standards Track 1 Presets
Track 1 Tokenized Field Segmentation
%B4111222233334444^MORGAN/ALEX^28122010000000000000?
Sentinels (% / ?) Format Code (B) PAN Name Expiry Service Code Discretionary
Primary Account Number (PAN)
4111222233334444
VisaLuhn Fail
Format: Code B (ISO 7813 Financial)
Cardholder Name
MORGAN/ALEX
Surname: MORGAN
Given Name / Initials: ALEX
Standard: Surname / First Name or Title
Expiration Date
12/2028Active
Encoded Value: YYMM = 2812

Service Code Analysis (Code: 201)

Digit 1 (2): Interchange & TechInternational Interchange (IC Card)

Valid globally; EMV integrated circuit chip must be used where available

Digit 2 (0): Authorization RulesNormal Authorization

Standard authorization processing by terminal rules

Digit 3 (1): PIN & RestrictionsNo Restrictions (Normal)

Valid at ATMs and point-of-sale terminals

Discretionary Data Field
0000000000000

Reserved for Card Verification Value 1 (CVV1/CVC1), PIN Verification Key Indicator (PVKI), PIN Verification Value (PVV), and proprietary bank routing bytes.

Longitudinal Redundancy Check (LRC)
Calculated: "P"

Computed by XORing the 6 data bits across all characters from Start Sentinel (%) to End Sentinel (?) inclusive.

Technical Architecture: ISO/IEC 7813 Magnetic Stripe Track 1 Engineering

The magnetic stripe on the back of credit cards, debit cards, transit passes, and hotel keycards represents one of the most enduring innovations in computing and banking history. Standardized under ISO/IEC 7811 (physical characteristics and recording techniques) and ISO/IEC 7813 (financial transaction cards), the magnetic stripe consists of three distinct physical tracks recorded across ferromagnetic iron oxide particles.

Among these, Track 1 was engineered specifically to bridge physical cards with human and electronic identification systems. While Track 2 was limited to numeric characters for automated teller machines (ATMs), Track 1 introduced alphanumeric encoding capable of recording the cardholder's legal surname, given name, title, and institutional metadata alongside account numbers and service parameters.

Physical & Bit-Level Encoding Architecture

Track 1 occupies the top position on the physical magnetic strip and is formatted according to rigid electrical and logical specifications:

  • Recording Density: 210 bits per inch (BPI) (approximately 8.27 bits per millimeter).
  • Maximum Capacity: Up to 79 characters, including control sentinels and the terminating parity check byte.
  • Character Set: 7-bit alphanumeric code (6 data bits + 1 odd parity bit), allowing up to 64 unique characters (ASCII 0x20 space through 0x5F underscore).
  • Encoding Method: Two-frequency coherent phase recording (F/2F), also known as Aiken Biphase. A flux reversal in the center of a bit cell signifies a binary 1, while the absence of a midpoint reversal signifies a binary 0.
Field Designator Length (Chars) Field Name Character Value / Standard Content
SS 1 char Start Sentinel % (ASCII 0x25 / Hex 25)
FC 1 char Format Code B (Financial interchange) or A (Airlines)
PAN Up to 19 digits Primary Account Number Credit or debit account number (ISO 7812)
FS1 1 char Field Separator 1 ^ (ASCII 0x5E / Caret)
Name 2 to 26 chars Cardholder Name SURNAME/FIRSTNAME INITIAL OR TITLE
FS2 1 char Field Separator 2 ^ (ASCII 0x5E / Caret)
Expiry 4 digits Expiration Date YYMM (Year: 2 digits, Month: 2 digits)
SC 3 digits Service Code 3-digit interchange, authorization & PIN rule matrix
Discretionary Variable Discretionary Data CVV1/CVC1, PVKI, PVV, bank routing flags
ES 1 char End Sentinel ? (ASCII 0x3F / Question mark)
LRC 1 char Longitudinal Redundancy Check Bitwise XOR parity character over SS through ES

Deconstructing the 3-Digit Service Code Matrix

The Service Code is a 3-digit numeric string located immediately following the 4-digit expiration date. It instructs point-of-sale terminals, transit turnstiles, and automated teller machines how the card must be processed:

Position 1: Interchange Rules & Integrated Circuit (IC) Technology

  • 1: International interchange, valid everywhere, normal magnetic stripe card.
  • 2: International interchange, valid everywhere, IC card (EMV Chip) present. The terminal must enforce chip insertion rather than swiping.
  • 5: National interchange only (domestic cards restricted to issuing country).
  • 6: National interchange only, IC card present.
  • 7: Private / closed loop (fleet fuel cards or proprietary retail store cards).
  • 9: Test card (authorized only for QA test environments and certification labs).

Position 2: Authorization Processing Requirements

  • 0: Normal authorization processing. Terminal may approve transactions offline within floor limits or request online authorization according to issuer risk rules.
  • 2: Contact issuer via online means mandatory. Terminal must dispatch a real-time ISO 8583 0100 authorization message for 100% of transactions.
  • 4: Contact issuer via online means mandatory, except under explicit bilateral merchant agreements.

Position 3: Range of Services & PIN Verification Requirements

  • 0: No restrictions. Valid for both point-of-sale purchases and ATM cash withdrawals; PIN required.
  • 1: No restrictions. Valid for POS purchases and ATM cash withdrawals; normal PIN or signature verification.
  • 2: Goods and services only. Valid for purchases at retail merchants; ATM cash withdrawals and cash-back are prohibited.
  • 3: ATM only. Cash withdrawals at automated teller machines only; POS merchant purchases prohibited.
  • 4: Cash only. Cash disbursements or cash advances only.
  • 5: Goods and services only; online or offline PIN entry is mandatory.
  • 6: Prompt for PIN if PIN Entry Device (PED) is available; fallback to signature if no keypad present.
  • 7: Prompt for PIN if PED is available; goods and services only.

The Mathematics of the Longitudinal Redundancy Check (LRC)

To detect signal dropouts, scratches, and demagnetization errors during manual card swipes, Track 1 incorporates a two-dimensional parity scheme:

  1. Vertical Parity (VRC): Every individual 7-bit character contains an odd parity bit (bit 7) configured so that the total count of 1 bits in each character is always odd.
  2. Longitudinal Redundancy Check (LRC): The final byte of the track performs a bitwise XOR ($\oplus$) across the 6 data bits of all preceding characters from the Start Sentinel (%) through the End Sentinel (?) inclusive: $$\text{LRC Data Bits} = \bigoplus_{i=\text{SS}}^{\text{ES}} \text{DataBits}_i$$

The LRC character is then appended with its own odd parity bit. When a card reader reads the magnetic waveform, it recalculates the LRC across the stream. If the calculated byte fails to match the recorded LRC byte, the hardware reader rejects the swipe with a magnetic read error.

TypeScript Implementation: Track 1 Parsing Algorithm

The following TypeScript implementation demonstrates how to parse a raw ISO/IEC 7813 Track 1 string and validate its constituent fields:

// Track1Parser.ts - ISO/IEC 7813 Track 1 Parser
export interface Track1Model {
  pan: string;
  cardholderName: string;
  expiryYear: string;
  expiryMonth: string;
  serviceCode: string;
  discretionaryData: string;
}

export function parseTrack1String(raw: string): Track1Model {
  // Strip optional Start Sentinel '%' and End Sentinel '?'
  let content = raw.trim();
  if (content.startsWith('%')) content = content.slice(1);
  if (content.startsWith('B') || content.startsWith('A')) content = content.slice(1);

  const esIndex = content.indexOf('?');
  if (esIndex !== -1) content = content.slice(0, esIndex);

  // Split on Field Separator '^'
  const parts = content.split('^');
  if (parts.length < 3) {
    throw new Error('Malformed Track 1 string: missing field separators');
  }

  const pan = parts[0].replace(/\D/g, '');
  const cardholderName = parts[1].trim();
  const trailer = parts[2];

  const expiryYY = trailer.slice(0, 2);
  const expiryMM = trailer.slice(2, 4);
  const serviceCode = trailer.slice(4, 7);
  const discretionaryData = trailer.slice(7);

  return {
    pan,
    cardholderName,
    expiryYear: '20' + expiryYY,
    expiryMonth: expiryMM,
    serviceCode,
    discretionaryData,
  };
}

EMV Fallback & Anti-Fraud Security Considerations

Magnetic stripes carry substantial vulnerability to skimming attacks because the data recorded on Track 1 is static: every swipe delivers the identical bit sequence to the terminal. To counter counterfeit card cloning, modern chip cards utilize EMV dynamic cryptograms (Tag 9F26 ARQC).

When a criminal clones Track 1 onto a counterfeit magnetic stripe card, the Service Code typically contains 201 or 220 (indicating an IC chip is present). If a cashier swipes this counterfeit card at an EMV-capable POS terminal, the terminal reads the Service Code, recognizes the 2 prefix, and displays: "Card has chip. Please insert card." If the criminal attempts to force a swipe by scratching the chip, the terminal flags the transaction as an EMV Fallback, prompting heightened issuer risk evaluation and shifting financial fraud liability directly to the merchant.

How to Use Track 1 Decoder

  1. Input Raw Track 1 Magstripe Stream

    Paste the raw magstripe string (e.g. %B4111...^DOE/JOHN^2812201...?) captured from hardware card readers.

  2. Deconstruct Sentinels, PAN & Name

    The parser separates Start Sentinel %, Format Code B, Primary Account Number, Field Separators ^, and Cardholder Name.

  3. Analyze Service Code & Verify LRC Parity

    Examine the 3-digit service code breakdown for chip and ATM requirements, inspect discretionary data, and verify the LRC checksum.

Authoritative Track 1 Example

Raw Track 1 String
%B4111222233334444^MORGAN/ALEX^28122010000000000000?
Decoded Components
Visa 16-Digit | Name: ALEX MORGAN | Expiry: 12/2028 | Service Code: 201 (EMV Chip International) | LRC Valid

Parsed in 1 millisecond with zero external network transmission.

Technical Specifications

  • Supported Inputs: ISO/IEC 7813 Track 1 Streams, Raw Hardware Swipes, Format B Magstripe Dumps
  • Input Limit: Up to 79 characters (ISO 7813 physical track limit)
  • Processing Engine: 100% In-Browser (ISO/IEC 7813 Alphanumeric Tokenization Engine)
  • Content Uploads: None (Your files and text are processed locally on your device with zero uploads)

Privacy & Security Guarantee

Your magnetic stripe payloads and payment track bytes are processed entirely in your web browser's memory using native client-side web technologies. Unlike traditional cloud tools, your content is never uploaded to remote servers, stored on external disks, or analyzed by third parties.

2ClickKit In-Browser vs Traditional Cloud Tools

Feature 2ClickKit (In-Browser) Traditional Cloud Services
Data Privacy Files never leave your local device Uploaded to remote servers and third-party clouds
Processing Speed Instant local execution (0ms upload time) Constrained by internet upload & server processing queues
Account & Costs 100% Free with zero registration or paywalls Tiered subscriptions, limits, or forced sign-ups

Best Practices & Tips

  • If a terminal fails to read a chip card and prompts to "fallback to swipe", it inspects Digit 1 of the Service Code (2 or 6) to log an EMV fallback transaction.
  • When testing POS software drivers, ensure your input parser strips out the terminating LRC character if the hardware magnetic stripe reader auto-validates parity.
  • Cardholder names in Track 1 use a slash (/) to separate surname from given name (e.g., MORGAN/ALEX).

Frequently Asked Questions

What is Track 1 on a payment card magnetic stripe?

Track 1 is an alphanumeric data track standardized under ISO/IEC 7813, recorded on the upper section of a payment card's magnetic stripe. Unlike Track 2 (which is strictly numeric), Track 1 contains alphanumeric characters recorded at 210 bits per inch (BPI) using a 7-bit character encoding (6 data bits plus 1 odd parity bit). It has a maximum length of 79 characters and contains the cardholder's full name in addition to the card number, expiration date, and service code.

What is the role of Start Sentinel % and End Sentinel ? in Track 1?

The Start Sentinel ('%', ASCII 0x25) signals the beginning of Track 1 data to the magnetic read head and analog-to-digital decoder. The End Sentinel ('?', ASCII 0x3F) marks the end of variable data fields. The byte immediately following the End Sentinel is the Longitudinal Redundancy Check (LRC) parity character.

What is Format Code B?

Format Code B (the character 'B' immediately following '%') specifies standard international financial card layout defined by ISO/IEC 7813. Format Code A was historically reserved for proprietary airline ticketing systems. Modern financial payment cards (Visa, Mastercard, Amex, Discover, JCB) universally utilize Format B.

How is the 3-digit Service Code interpreted?

The Service Code is a 3-digit numeric value that specifies technical and operational rules for the terminal. Digit 1 dictates international vs national interchange and whether an EMV IC chip is present (e.g., '2' means international card with EMV chip). Digit 2 specifies authorization processing (e.g., '0' means normal authorization; '2' requires positive online authorization). Digit 3 dictates PIN requirements and service restrictions (e.g., '1' means no restrictions; '0' requires PIN; '3' is ATM only).

What is the Longitudinal Redundancy Check (LRC)?

The Longitudinal Redundancy Check (LRC) is an error-detecting checksum character located at the very end of the track. It is computed by performing a bitwise XOR across all 6-bit data characters from the Start Sentinel (%) to the End Sentinel (?) inclusive. If dirt or magnetic demagnetization corrupts any bit during swiping, the calculated LRC mismatches, prompting the terminal to request a re-swipe.

Why does Track 1 contain the cardholder name while Track 2 does not?

Track 1 was engineered with 210 BPI density to accommodate alphanumeric text (ASCII characters), allowing POS terminals, airline boarding gate readers, and hotel check-in desks to display and print the cardholder's name. Track 2 was engineered with 75 BPI density and restricted strictly to 4-bit BCD numeric characters to ensure high read reliability on early ATM mechanical card readers.

What is Discretionary Data in Track 1?

Discretionary Data is a variable-length string allocated to the card-issuing bank. For magnetic stripe transactions, it typically embeds Card Verification Value 1 (CVV1 or CVC1), PIN Verification Key Indicator (PVKI), PIN Verification Value (PVV), and proprietary bank routing flags to detect magnetic stripe skimming and card cloning.

Is it safe to decode magnetic stripe strings on 2ClickKit?

Yes, 100%. 2ClickKit executes entirely inside your browser tab using local client-side JavaScript. No magnetic stripe strings, cardholder names, or payment account numbers are ever sent across the network or stored in external logs, maintaining full compliance with PCI-DSS guidelines.