Test data for Brazilian software
EN
Fictitious data for software testing. Using fake documents for fraud is a crime in Brazil (Penal Code, arts. 297–299, 307).

Test card number generator and validator

Generate fictitious card numbers with a correct brand prefix and Luhn check digit to test input masks, form validation and brand detection — including Brazil’s Elo and Hipercard. They cannot be used to pay for anything; for real sandbox payment tests, use each gateway’s official test cards listed on this page.

—

Up to 1000 items at once. Everything is generated in your browser.

Official gateway test cards (sandbox)

To test real payment flows in a sandbox, use the numbers each gateway publishes. They only work in that gateway’s test mode.

GatewayBrandNumberBehaviour
StripeVisa4242 4242 4242 4242Successful payment
StripeMastercard5555 5555 5555 4444Successful payment
StripeVisa4000 0007 6000 0002Brazil-issued card; successful payment
StripeVisa4000 0000 0000 0002Declined (generic_decline)
AdyenElo5066 9911 1111 1118Elo test card, issued in BR
AdyenHipercard6062 8288 8866 6688Hipercard test card, issued in BR
Mercado PagoMastercard5480 8328 0103 3311Credit; outcome set by cardholder name (APRO = approved)
Mercado PagoVisa4235 6477 2802 5682Credit; outcome set by cardholder name (APRO = approved)
Mercado PagoElo5067 7667 8388 8311Debit; outcome set by cardholder name (APRO = approved)
PagBankVisa4539 6206 5992 2097Authorised (AUTHORIZED or PAID)
PagBankVisa4929 2918 9838 0766Declined (DECLINED)
PagBankMastercard5240 0829 7562 2454Authorised (AUTHORIZED or PAID)
PagBankElo4514 1611 2211 3757Authorised (AUTHORIZED or PAID)
PagBankHipercard6062 8285 9891 9021Authorised (AUTHORIZED or PAID)

How to use

  1. On the Generate tab, pick a Brand (Visa, Mastercard, American Express, Elo, Hipercard, Diners Club, Discover, JCB) or leave it on Random.
  2. Tick With mask (punctuation) to group digits with spaces (e.g. 5555 5555 5555 4444), or untick it for digits only.
  3. Set the Quantity (1 to 1000) and click Generate. Each row shows the brand, the number and the TEST label.
  4. Use Copy, Export CSV or Export JSON to move the data into fixtures and automated tests.
  5. On the Validate tab, paste one number per line and click Validate: each line shows whether it passes the Luhn check, the detected brand, or the reason it failed (length, characters or check digit).

How it works

How a card number is built

Under ISO/IEC 7812, a card number (PAN) starts with the IIN/BIN — the prefix identifying the network and issuer — continues with account digits and ends with a check digit computed with the Luhn (mod 10) algorithm. The generator uses these prefixes and lengths. Elo and Hipercard are Brazilian domestic card brands that you will meet in any Brazilian checkout.

BrandPrefixes usedDigits
Visa416
Mastercard51–55, 2221, 2500, 272016
American Express34, 3715
Elo636368, 438935, 504175, 451416, 636297, 506699, 50900016
Hipercard60628216
Diners Club300, 305, 36, 380, 38914
Discover6011, 644, 645, 649, 65816
JCB3528, 358916

When validating, the brand is detected from the most specific prefixes first, because Elo and Hipercard ranges overlap Visa, Mastercard and Discover ranges. Numbers of 12 to 19 digits are accepted.

The Luhn algorithm step by step

Take the public test card 5555 5555 5555 4444 (Stripe). Without the last digit, the base is 555555555555444. Working right to left, double the 1st, 3rd, 5th… digit; if a doubled value exceeds 9, subtract 9:

  1. Digits read from the right: 4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5.
  2. Doubling the odd positions: 4→8, 4→8 and each of the six 5s → 10 → 1. The other positions (one 4 and six 5s) stay as they are.
  3. Sum: 8 + 8 + 6×1 + 4 + 6×5 = 56.
  4. Check digit: (10 − 56 mod 10) mod 10 = (10 − 6) mod 10 = 4. Full number: 5555 5555 5555 4444.

Why these numbers cannot buy anything

Passing Luhn only proves there is no typo. A purchase needs the issuing bank to authorise it, which requires a real account, an expiry date, a security code and the bank’s fraud checks. The numbers generated here are linked to no account, and the tool produces no CVV or expiry date. Any real attempt is simply declined — and that is not what they are for.

Testing payments in a sandbox

To test approvals, declines or 3-D Secure, use your gateway’s test environment with test API keys and the official test cards it publishes; randomly generated numbers are usually rejected by sandboxes. The “Official gateway test cards” table, just below the tool, lists official cards from Stripe, Adyen, Mercado Pago and PagBank, with a link to each provider’s documentation.

FAQ

Can I use these numbers to make a purchase or sign up?

No. The numbers are fictitious, tied to no account and come without CVV or expiry, so any real authorisation is declined by the issuer. They exist to test masks, form validation, brand detection and storage in development environments. Using them to deceive real services is not what this tool is for.

Which card should I use in my payment gateway’s sandbox?

Always the gateway’s own official test cards, together with test API keys. Each provider defines which numbers approve, decline or trigger 3-D Secure; with Mercado Pago, for example, the outcome depends on the cardholder name you enter. Check the table on this page and each gateway’s docs before building your scenarios.

What exactly does the validator check?

It strips spaces and hyphens, requires 12 to 19 digits, verifies the Luhn check digit and tries to identify the brand from the prefix. It does not contact the issuer and cannot tell whether a card exists, is active or has available credit. A valid result only means the number is well formed.

Why is an Elo card detected as Elo and not Visa?

Some Elo BINs start with 4 or 5 — ranges normally associated with Visa or Mastercard — and Hipercard has its own prefixes too. The detector therefore tests the most specific prefixes (Elo, Hipercard) before the generic ones. If your system picks the brand from the first digit alone, it will misclassify Brazilian cards.

How should I handle card numbers safely in tests?

Treat the field as sensitive even in tests. In production, PCI DSS forbids storing full card numbers without protection, and the usual approach is tokenisation through your gateway. In test environments, use only fictitious numbers or official sandbox cards — never real cards belonging to team members.

Sources

Related tools

Updated 2026-11-13 · Rafael Lima