About UnionPay card numbers
China UnionPay was set up in Shanghai in 2002 to connect the payment systems of Chinese banks. It has since become the largest card network in the world by number of cards issued, and UnionPay cards are accepted in most countries. If your shop sells to visitors or customers from mainland China, UnionPay support is often worth testing.
UnionPay numbers start with 62 and are 16 to 19 digits long. The 3-digit security code on the back is called CVN2. The range 622126–622925 is shared with Discover: in the United States, those cards are routed on the Discover network. The generator therefore avoids 622 and uses 620–621 and 623–628, so every number is detected as UnionPay.
UnionPay is also the brand where validation code most often goes wrong. Not every UnionPay card number satisfies the Luhn check, so many payment libraries skip the Luhn test for numbers starting with 62 — and some gateways publish UnionPay test numbers that fail it. The numbers generated here always pass Luhn, which is the safe default for testing your own validation. If you accept UnionPay in production, check how your library handles 62-prefixed numbers that fail Luhn.
Lengths matter as well: test both 16-digit and 19-digit numbers (for example Stripe’s 19-digit test card 6205 5000 0000 0000 004) to make sure your input field and database column don’t truncate them. For gateway sandboxes, Stripe documents 6200 0000 0000 0005, and Braintree lists 6243 0300 0000 0001.
When you display UnionPay numbers, group them in fours like other brands and make sure a 19-digit number is not cut off. Store the digits without spaces and only add grouping in the UI. Customers from mainland China also commonly pay with wallets linked to UnionPay cards, so if UnionPay matters for your business, check whether your payment provider offers those methods too.
UnionPay number format
| Starts with (IIN) | 62 |
|---|---|
| Number length | 16–19 digits |
| Typical layout | 62xx xxxx xxxx xxxx |
| Security code | 3-digit CVN2 on the back |
| Check digit | Last digit, calculated with the Luhn (mod 10) algorithm |
| Network | China UnionPay |
Official UnionPay sandbox test numbers
Payment gateways publish fixed test numbers that only work in their test mode. Use them when you need a predictable gateway response; use the generator above for bulk or randomized data.
| Gateway | Test number | |
|---|---|---|
| Stripe | 6200 0000 0000 0005 |
Sources: the gateways' own documentation — Stripe, PayPal, Braintree, Adyen.
How to test UnionPay payments safely
- Generate a batch of UnionPay numbers above and paste them into your form to confirm brand detection, length and formatting.
- Change one digit of a generated number — your form should now reject it, because the Luhn check fails. You can confirm why with the validator.
- Switch your payment provider to sandbox / test mode and use its documented test cards for authorization, decline and 3-D Secure scenarios.
- Never use real customer card numbers in development or staging environments.
Frequently asked questions
What do UnionPay card numbers start with?
62. Numbers from 622126 to 622925 are co-branded with Discover and may be routed as Discover in the United States.
Do UnionPay cards always pass the Luhn check?
No. Most do, but UnionPay does not require it for every card, so many validators skip Luhn for 62-prefixed numbers. All numbers generated here pass Luhn.
What is a UnionPay test card number?
Stripe documents 6200 0000 0000 0005 (16 digits) and 6205 5000 0000 0000 004 (19 digits) for test mode.
Are these real UnionPay cards?
No. They follow the UnionPay format but are not linked to any account and cannot be used to pay.