Appendix B - Credit Card Number Formats
This appendix has two parts. The first provides basic information about card numbers, such as length, prefixes, and validation numbers. The second part provides information about the Luhn Mod-10 algorithm used to validate account numbers.
Credit Card Number Formats:
Table B-1 provides information on number formats for various credit card types.
The data presented here is for informational proposes only and is subject to change by the Credit Card Associations/Companies. You should verify the information using additional sources prior to using it to create or alter any of your business systems, processes, or procedures.
TABLE B-1 Card Number Formats
Card Type |
Card Number Prefix/Range |
Number Length |
Card Validation Number Length |
Comments |
---|---|---|---|---|
American Express |
34 and 37 |
15 digits |
4 digits |
|
Diners Club International |
36 |
14 digits |
3 digits |
Submit account numbers starting with 36 as Discover. |
Diners Club (US and Canada) |
54 and 55 |
16 digits |
3 digits |
Submit account numbers starting with 54 and 55 as Mastercard. |
Discover |
30000000-30599999 30880000-31099999 31120000-31209999 31580000-31599999 33370000-33499999 35280000-35899999 36 38 39 64 65 60110000-60110999 60112000-60114999 60117400-60117499 60117700-60117999 60118600-60119999 62212600-62379699 62400000-62699999 62820000-62889999 81000000-81719999 |
14 digits or 16 digits |
3 digits |
Includes ranges for China UnionPay, JCB, and Diners Club International supported by Discover in the US. Acceptance of Discover means you accept these other types of payment, too. |
Mastercard |
51-55 222100 - 272099 |
16 digits or 19 digits |
3 digits |
|
Visa |
4 |
16 digits or 19 digits |
3 digits |
|
Luhn Mod-10 Algorithm for Card Number Validation:
The Luhn Mod-10 algorithm was invented in 1954 by IBM scientist Hans Peter Luhn and is a relatively simple formula used in numerous applications to validate identification numbers, including credit cards. The algorithm detects all single digit errors in an account number, as well as most transpositions of adjacent numbers.
Use the following method to determine if an account number is Mod-10 compliant:
-
Working from the right, double every other number. If the result of any doubling is a 2-digit number, treat them as individual digits for step 2. For example, 2 * 9 = 18, should be treated as a 1 and an 8.
-
Add all the numbers together, including those you did not double. Remember to treat any 2-digit numbers as individual numbers.
-
If the result of step 2 is a multiple of 10, the account number is Mod-10 compliant.
Example: Mod-10 Algorithm
For the account number 4005550000081019, the computations are shown in the table below.
4 |
0 |
0 |
5 |
5 |
5 |
0 |
0 |
0 |
0 |
0 |
8 |
1 |
0 |
1 |
9 |
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
x2 |
|
x2 |
|
x2 |
|
x2 |
|
x2 |
|
x2 |
|
x2 |
|
x2 |
|
8 |
0 |
0 |
5 |
10 |
5 |
0 |
0 |
0 |
0 |
0 |
8 |
2 |
0 |
2 |
9 |
8+ |
0+ |
0+ |
5+ |
1+0+ |
5+ |
0+ |
0+ |
0+ |
0+ |
0+ |
8+ |
2+ |
0+ |
2+ |
9 |
The result is 40, which is a multiple of 10 and therefore compliant.