UnionPay Card Number Validator
Check whether a number looks like a valid UnionPay card: the 62 or 81 prefix, the 16 to 19 digit length and the Luhn check digit. Everything runs in your browser.
UnionPay card number format at a glance
| Starts with (IIN) | 62; 8100 to 8171 |
|---|---|
| Length | 16 to 19 digits |
| Security code | CVN2, 3 digits, back of the card |
| Luhn check digit | Mostly. Most UnionPay cards use a Luhn check digit, but some older domestic cards do not, so many processors skip the Luhn check for UnionPay. |
| Issued in | Mainly mainland China, plus issuing banks across Asia and other regions. |
| Network operator | China UnionPay |
UnionPay IIN (BIN) ranges
| Prefix | Notes |
|---|---|
| 62 | Main UnionPay range |
| 8100 to 8171 | Newer UnionPay ranges |
What the first digits mean
A first digit of 6 is the ISO/IEC 7812 merchandising and banking category. UnionPay holds most of the 62 range and newer 81 ranges. Cards in 622126-622925 are also routed as Discover in the US.
A prefix tells you the network, not the bank. To see the issuing bank, country and card type behind a UnionPay BIN, use the BIN lookup tool or browse the full UnionPay BIN list.
Worked Luhn example with a UnionPay test number
This uses a public test number from the Stripe testing docs. It passes every format check but is not a real account, so it cannot be charged.
Most UnionPay cards use a Luhn check digit, but some older domestic cards do not, so many processors skip the Luhn check for UnionPay.
Number: 6200 0000 0000 0005 (16 digits)
- Start from the rightmost digit (the check digit) and move left.
- Double every second digit, starting with the one just left of the check digit.
- If doubling gives a number above 9, subtract 9 (same as adding its two digits).
- Add every value together. The number is valid if the total ends in 0.
| Digit | 6 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Double? | x2=12 | - | x2=0 | - | x2=0 | - | x2=0 | - | x2=0 | - | x2=0 | - | x2=0 | - | x2=0 | - |
| Value | 3 | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5 |
Total: 10. 10 mod 10 = 0, so the number passes the Luhn check.
Working backwards: without the check digit, the other digits add up to 5. The check digit is whatever brings that total to the next multiple of 10: (10 - 5) mod 10 = 5, which matches the last digit.
Why a valid UnionPay card number still declines
Passing the Luhn and length checks only proves the number is well formed. Whether the payment goes through is decided by the issuer, and these are the common reasons a UnionPay card is still declined:
Strict Luhn validation
Some genuine UnionPay numbers do not pass the Luhn check. A checkout that hard-blocks Luhn failures turns those customers away.
UnionPay not enabled on the merchant account
Outside Asia, many acquirers do not enable UnionPay by default.
Cross-border and authentication rules
Issuers can restrict online or foreign-currency spending, and many UnionPay payments require extra cardholder authentication.
Insufficient funds
The number is fine, but the account cannot cover the amount right now. This is a soft decline: retrying after payday or once the balance recovers often succeeds.
Expired or replaced card
Luhn and length checks never look at the expiry date. A card reissued after loss, fraud or expiry keeps failing until the customer updates it or a card updater service supplies the new details.
Look up the exact response code in the decline code glossary to see whether it is a soft decline worth retrying or a hard decline that needs the customer.
UnionPay card number FAQ
How many digits is a UnionPay card number?
A UnionPay card number is 16 to 19 digits. The last digit is a check digit.
What does a UnionPay card number start with?
UnionPay card numbers start with 62 or 81. Some UnionPay ranges (622126-622925) are also accepted as Discover in the US.
What is the CVN2 on a UnionPay card?
The CVN2 (Card Verification Number 2) is the 3-digit security code on the back of the card. It is not part of the card number, so a number validator cannot check it.
Do UnionPay card numbers use the Luhn algorithm?
Mostly. Most UnionPay cards use a Luhn check digit, but some older domestic cards do not, so many processors skip the Luhn check for UnionPay.
Why would a valid UnionPay card number still be declined?
A valid number only proves the format is right. Strict Luhn validation, UnionPay not enabled on the merchant account, Cross-border and authentication rules are common reasons a UnionPay payment still fails.