Advertisement

Prefix 62 · 16–19 digits · 3-digit CVV

UnionPay Card Number Generator

Generate 16-digit China UnionPay test numbers starting with 62 that pass the Luhn check, with a random expiry date and 3-digit CVN2.

Advertisement
Generated cards

Test data only — these numbers are not issued by any bank and every real payment with them will be declined.

Advertisement

Generated locally with your browser’s crypto API — nothing is sent to a server.

UnionPay format

Starts with
62
Length
16–19
Security code
3
Stripe
6200 0000 0000 0005
Advertisement

Brand ranges at a glance

The prefixes and lengths your checkout must accept. Each brand has its own generator page.

For developers & QA

Test data that stays out of PCI scope

Use generated numbers for everything before the payment request, then switch to your gateway’s official sandbox cards for approvals, declines and 3-D Secure.

  • Test form validation & input masks
  • Seed staging databases and demos
  • Reproduce declines and 3-D Secure in the sandbox
Browse gateway test cards

Official sandbox cards, per gateway

All 18 gateways →

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 length16–19 digits
Typical layout62xx xxxx xxxx xxxx
Security code3-digit CVN2 on the back
Check digitLast digit, calculated with the Luhn (mod 10) algorithm
NetworkChina UnionPay
Advertisement

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.

GatewayTest number
Stripe6200 0000 0000 0005

Sources: the gateways' own documentation — Stripe, PayPal, Braintree, Adyen.

How to test UnionPay payments safely

  1. Generate a batch of UnionPay numbers above and paste them into your form to confirm brand detection, length and formatting.
  2. 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.
  3. Switch your payment provider to sandbox / test mode and use its documented test cards for authorization, decline and 3-D Secure scenarios.
  4. Never use real customer card numbers in development or staging environments.
Generated UnionPay numbers are for testing only. They are not linked to any UnionPay account, hold no balance and will be declined by any live payment system.

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.

Related tools

Advertisement