You are on page 1of 3

ISO/IEC 7813

From Wikipedia, the free encyclopedia

ISO/IEC 7813 is an international standard codified by the International Organization for Standardization and
International Electrotechnical Commission that defines properties of financial transaction cards, such as ATM
or credit cards.[1]

Contents
1 Scope
2 Physical characteristics
3 Magnetic tracks
3.1 Track 1
3.1.1 Examples
3.2 Track 2
3.3 Track 3
3.4 Programming
3.4.1 Track 1
4 References
5 External links
5.1 Reference implementations

Scope
The standard defines:

physical characteristics, such as size, shape, location of magnetic stripe, etc.


magnetic track data structures

Physical characteristics
ISO/IEC 7813 specifies the following physical characteristics of the card, mostly by reference to other
standards:

Embossed characters
by reference to ISO/IEC 7811
Embossing of expiration date
the format (MM/YY or MM-YY)
Magnetic stripe
by reference to ISO/IEC 7811
Integrated circuit with contacts
by reference to ISO/IEC 7816-1
Integrated circuit without contacts
by reference to ISO/IEC 10536-1, ISO/IEC 14443-1, and ISO/IEC 15693-1

Magnetic tracks
Track 1

The Track 1 structure is specified as:


STX : Start sentinel "%"
FC : Format code "B" (The format described here. Format "A" is reserved for proprietary use.)
PAN : Primary Account Number, up to 19 digits
FS : Separator "^"
NM : Name, 2 to 26 characters (including separators, where appropriate, between surname, first name
etc.)
FS : Separator "^"
ED : Expiration data, 4 digits or "^"
SC : Service code, 3 digits or "^"
DD : Discretionary data, balance of characters
ETX : End sentinel "?"
LRC : Longitudinal redundancy check, calculated according to ISO/IEC 7811-2

The maximum record length is 79 alphanumeric characters.

Examples

%B4815881002861896^YATES/EUGENE JOHN ^37829821000123456789?

%B4815881002861896^YATES/EUGENE L ^^^0000000 00998000000?

Track 2

The Track 2 structure is specified as:

STX : Start sentinel ";"


PAN : Primary Account Number, up to 19 digits, as defined in ISO/IEC 7812-1
FS : Separator "="
ED : Expiration date, YYMM or "=" if not present
SC : Service code, 3 digits or "=" if not present
DD : Discretionary data, balance of available digits
ETX : End sentinel "?"
LRC : Longitudinal redundancy check, calculated according to ISO/IEC 7811-2

The maximum record length is 40 numeric digits (e.g., 5095700000000).

Track 3

Track 3 is virtually unused by the major worldwide networks and often isn't even physically present on the card
by virtue of a narrower magnetic stripe.

A notable exception to this is Germany, where Track 3 content was used nationally as the primary source of
authorization and clearing information for debit card processing prior to the adoption of the "SECCOS" ICC
standards. Track 3 is standardized nationally to contain both the cardholder's bank account number and branch
sort code (BLZ).

Programming

Parsing Track 1 and Track 2 can be done with Regular Expressions. Included here is just the Regular
Expression for parsing Track 1.

Track 1

^%([A-Z])([0-9]{1,19})\^([^\^]{2,26})\^([0-9]{4}|\^)([0-9]{3}|\^)([^\?]+)\?$
This Regex will capture all of the important fields into the following groups:

Group 1: Format Code


Group 2: Primary account number (PAN)
Group 3: Name
Group 4: Expiration Date
Group 5: Service Code
Group 6: Discretionary data

References
1. ISO/IEC 7813:2006 Information technology -- Identification cards -- Financial transaction cards
(http://www.iso.org/iso/
iso_catalogue/catalogue_tc/catalogue_detail.htm?csnumber=43317)

External links
Reference implementations
Magnetic Track Parser, a Java library to parse magnetic track data
Credit Card Track Data Parser, a Javscript library is for parsing credit card track data such as might be
returned from a USB card reader
magnet, a Ruby library for decoding the track data on magnetic stripe cards

Retrieved from "https://en.wikipedia.org/w/index.php?title=ISO/IEC_7813&oldid=780424520"

Categories: ISO/IEC standards

This page was last edited on 15 May 2017, at 00:58.


Text is available under the Creative Commons Attribution-ShareAlike License; additional terms may
apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia is a registered
trademark of the Wikimedia Foundation, Inc., a non-profit organization.

You might also like