Nov 18, 2010 I need to know the test credit card numbers. I remember seeing a screen when I first created an account that had them but I can't find them anywhere. I know that Visa is 222222 but what are the others, specifically MasterCard?
Validate a credit card number
Fake credit card numbers for all major brands
These credit card numbers DO NOT work! They are for testing purposes only. Without a valid owner name, an expiration date and a valid CVV code, they can't be used for real transactions. You should use these numbers only to test your validation strategies and for bogus data. Note that the algorithm used here is freely available across the web even Wikipedia.org. These numbers were generated randomly.You can refresh the page to get new numbers.
- VISA:
- MasterCard:
- American Express (AMEX):
- Discover:
- JCB:
- Diners Club - North America:
- Diners Club - Carte Blanche:
- Diners Club - International:
- Maestro:
- Visa Electron:
- InstaPayment:
How to validate a Credit Card Number?
Most credit card number can be validated using the Luhn algorithm, which is more or a less a glorified Modulo 10 formula!
The Luhn Formula:
- Drop the last digit from the number. The last digit is what we want to check against
- Reverse the numbers
- Multiply the digits in odd positions (1, 3, 5, etc.) by 2 and subtract 9 to all any result higher than 9
- Add all the numbers together
- The check digit (the last number of the card) is the amount that you would need to add to get a multiple of 10 (Modulo 10)
Luhn Example:
Step | Total | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Original Number: | 4 | 5 | 5 | 6 | 7 | 3 | 7 | 5 | 8 | 6 | 8 | 9 | 9 | 8 | 5 | 5 | |
Drop the last digit: | 4 | 5 | 5 | 6 | 7 | 3 | 7 | 5 | 8 | 6 | 8 | 9 | 9 | 8 | 5 | ||
Reverse the digits: | 5 | 8 | 9 | 9 | 8 | 6 | 8 | 5 | 7 | 3 | 7 | 6 | 5 | 5 | 4 | ||
Multiple odd digits by 2: | 10 | 8 | 18 | 9 | 16 | 6 | 16 | 5 | 14 | 3 | 14 | 6 | 10 | 5 | 8 | ||
Subtract 9 to numbers over 9: | 1 | 8 | 9 | 9 | 7 | 6 | 7 | 5 | 5 | 3 | 5 | 6 | 1 | 5 | 8 | ||
Add all numbers: | 1 | 8 | 9 | 9 | 7 | 6 | 7 | 5 | 5 | 3 | 5 | 6 | 1 | 5 | 8 | 85 | |
Mod 10: | 85 modulo 10 = 5 (last digit of card) |
List of credit card number formats
Credit Card Issuer | Starts With ( IIN Range ) | Length ( Number of digits ) |
---|---|---|
American Express | 34, 37 | 15 |
Diners Club - Carte Blanche | 300, 301, 302, 303, 304, 305 | 14 |
Diners Club - International | 36 | 14 |
Diners Club - USA & Canada | 54 | 16 |
Discover | 6011, 622126 to 622925, 644, 645, 646, 647, 648, 649, 65 | 16-19 |
InstaPayment | 637, 638, 639 | 16 |
JCB | 3528 to 3589 | 16-19 |
Maestro | 5018, 5020, 5038, 5893, 6304, 6759, 6761, 6762, 6763 | 16-19 |
MasterCard | 51, 52, 53, 54, 55, 222100-272099 | 16 |
Visa | 4 | 13-16-19 |
Visa Electron | 4026, 417500, 4508, 4844, 4913, 4917 | 16 |
To test your payment forms, you will obviously need a proper set of card data. There’s no need for you to use your own card for that. Although no money will be processed with a test account, you will most likely want to perform tests that simulate certain situations, for example different brands of credit cards. Here’s a table with a set of test credit card numbers that can be used for simulations.
You can also trigger a transaction error (for testing purposes) by entering an error code as transaction amount.
Number | Vendor | Notes/purpose |
---|---|---|
4111111111111111 | Visa | Sale successful. |
4200000000000000 | Visa | Sale successful. |
5500000000000004 | MasterCard | Sale successful. |
370000000000002 | American Express | Sale successful. |
586824160825533338 | Maestro International | Sale successful. |
Number | Vendor | Notes/purpose |
---|---|---|
4012001036275556 | Visa | Unable to verify card enrollment (enrollment check error 720) |
4012001038488884 | Visa | Unable to verify card enrollment (enrollment check error 720) |
4012001036298889 | Visa | Unable to verify card enrollment (enrollment check error 720) |
4012001038443335 | Visa | 3-D Secure Enrollment testing – card not enrolled in 3-D Secure |
4012001036853337 | Visa | Card enrolled, verification failed (sale error 703) |
4012001036983332 | Visa | Card enrolled, verification failed (sale error 703) |
4012001037490006 | Visa | Card enrolled, verification failed (sale error 703) |
4012001037167778 | Visa | Card not eligible for 3-D Secure, sale successful |
4012001037461114 | Visa | Card enrolled, authentication failure (sale error 704) |
4012001037484447 | Visa | Card enrolled, authentication not available (sale error 725) |
Number | Vendor | Notes/purpose |
---|---|---|
4055018123456780 | Visa | AVS result “X” (exact match) |
4055019123456788 | Visa | AVS result “Y” (exact match) |
4055010123456787 | Visa | AVS result “A” (ZIP mismatch) |
4055017123456782 | Visa | AVS result “W” (street mismatch) |
4055020123456786 | Visa | AVS result “Z” (street mismatch) |
4055013123456781 | Visa | AVS result “N” (ZIP and street mismatch) |
4055011123456785 | Visa | AVS result “E” (logical error/AVS not supported) |
4055012123456783 | Visa | AVS result “G” (logical error/AVS not supported) |
4055015123456786 | Visa | AVS result “S” (logical error/AVS not supported) |
4055016123456784 | Visa | AVS result “U” (logical error/AVS not supported) |
4055014123456789 | Visa | AVS result “R” (technical error/issuer not available) |