{{ primaryActionStatusText }}
Generate one Luhn-valid sandbox number, or choose a saved QA batch profile below.
{{ presetSummary }}
Use 1 to 100; leave 1 for a single card number.
Digits only, such as 411111; leave blank for bundled prefixes.
{{ binNotice }}
Choose plain digits, spaced groups, or dashed groups.
Turn on when the QA form requires a security code.
{{ include_cvv ? 'On' : 'Off' }}
Turn on when the QA form requires an expiry date.
{{ include_expiry ? 'On' : 'Off' }}
Use only with sandbox, demo, and QA systems. Generated values pass format checks but are not processor scenario cards or live payment credentials.
Use 0 for the network default, or 12 to 24 total digits.
digits
{{ mask_last }}
Use 0 for full preview or mask up to the current card length.
Auto uses 4 digits for AmEx and 3 digits for other bundled networks.
Use 1 to 120 months; minimum must be no later than maximum.
Enter the minimum months ahead, from 1 to 120.
Enter the maximum months ahead; it cannot be below the minimum.
Turn on to keep generated numbers within the selected network shape.
{{ enforce_network_prefix ? 'On' : 'Off' }}
Turn on for fixture batches where each row should be distinct.
{{ unique_batch ? 'On' : 'Off' }}
Use up to 64 characters, or leave blank for browser entropy.
Network Number Leading digits Digits CVV Expiry Copy
{{ item.label }} {{ item.display }} {{ item.prefix }} {{ item.length }} {{ item.cvv || '—' }} {{ item.expiry || '—' }}
Metric Value Copy
{{ row.label }} {{ row.value }}
Leading digits Cards Share Digits seen Copy
{{ row.prefix }} {{ row.count }} {{ row.share }} {{ row.lengthsLabel }}
Customize
Advanced
:

Introduction:

Payment interfaces need realistic test data before any real authorization, tokenization, or cardholder record is involved. A checkout form may reject the wrong length, trim spaces incorrectly, mishandle American Express security codes, or mask the wrong digits in a confirmation view. Those are application problems that can be tested with card-shaped numbers instead of live payment credentials.

A payment card number is a structured identifier, not an arbitrary string of digits. The leading issuer digits make the value resemble a network range, the middle digits fill the issuer-controlled account space, and the final digit is a checksum. Older payment docs and many QA tickets still say BIN, while current standards use IIN, short for Issuer Identification Number. In day-to-day testing, both terms usually mean the leading digits that cause software to choose a Visa, American Express, Mastercard, Discover, Diners Club, JCB, Maestro, UnionPay, or similar branch.

Payment card number anatomy with issuer digits, account digits, and a Luhn check digit

Good synthetic card data is useful because many failures happen before a gateway sees a request. Length checks, pasted separators, display grouping, hidden raw values, optional CVV fields, expiry windows, and masking all sit inside the product being tested. A batch of generated values gives testers enough variety to exercise those branches without collecting real cardholder data.

  • Form QA: check length, grouping, masking, and security-code fields.
  • Fixtures: keep the same sample rows in unit tests, bug reports, and screenshots.
  • Demos: show realistic-looking values while making clear that no payment credential is present.
  • Gateway preparation: separate front-end validation from provider-specific test scenarios.

The limit is just as important as the structure. A number can pass the Luhn checksum and still have no issuer, no account, no available funds, and no authorization path. Processor sandboxes often require their own published test cards or tokens for approvals, declines, 3-D Secure flows, fraud rules, refunds, disputes, and webhooks.

How to Use This Tool:

Start with the card shape your test case needs, then add only the fields the target form actually requires. Each run replaces the current batch, so the tables, metrics, chart, and JSON describe the latest settings only.

  1. Choose a Network or a Batch profile. Profiles fill common QA setups such as a checkout batch, an American Express form pass, a masked demo, or a replayable Visa BIN batch.
  2. Set Quantity from 1 to 100. Leave it at 1 for a single lead card, or increase it when you need fixture rows for a table, import, or repeated form test.
  3. Use Custom BIN / IIN only when a test case needs specific leading digits. With Enforce network prefix on, a mismatched custom prefix falls back to the bundled network ranges and shows a warning before generation.
  4. Pick the Display format for review and screenshots. Plain digits, spaces, and dashes change the preview only; number-copy actions keep the raw digit-only value.
  5. Turn on Include CVV / CVC or Include expiry when the target form requires those fields. The advanced controls let you force 3- or 4-digit CVV values and set the future expiry window from 1 to 120 months.
  6. Open Advanced for length overrides, masked trailing digits, unique-batch enforcement, and a replay Seed. If the unique-batch warning says the capacity is too small, shorten the custom prefix, increase the length, lower the quantity, or allow repeats.
  7. Select Generate test number, then review Generated Cards, Generation Metrics, Observed Prefixes, Prefix Mix Chart, and JSON before copying values into your test case.

For screenshots or docs, combine a masked preview with a clear note that the values are sandbox-only. For automated tests, keep the seed and every generation setting unchanged so the same rows can be reproduced later.

Interpreting Results:

The raw value behind each row in Generated Cards is the value to paste into a test form. The formatted Number column is meant for review and screenshots, while Leading digits and Digits confirm which prefix and length were actually used.

  • Luhn validity should read All generated rows passed in Generation Metrics. That means the checksum is internally consistent, not that a bank issued the card.
  • Prefix strategy tells you whether the batch used your custom BIN / IIN or a bundled fallback after a mismatch.
  • RNG source and Replay seed separate reproducible batches from unseeded browser-random batches.
  • Observed Prefixes and Prefix Mix Chart show the distribution inside the latest batch. A small batch is a QA sample, not a statistical model of real card issuance.

Do not treat generated success as payment success. After the form behaves correctly, use your processor's own test cards or tokens to test approvals, declines, authentication, fraud rules, settlement behavior, refunds, and webhooks.

Technical Details:

The payment card number is usually called a Primary Account Number, or PAN. Under the ISO/IEC 7812 model, a PAN has issuer identification digits, issuer-controlled account digits, and a final check digit. The modern interchange IIN is eight digits, although six-digit BIN language remains common in product teams, gateway docs, and legacy data exports.

Synthetic card generation for QA only needs a practical subset of that structure. The issuer portion must resemble an accepted network range, the body must contain enough digits to reach the requested length, and the final digit must satisfy the Luhn mod-10 check. That is enough for many browser and application validators, but it deliberately stops short of issuer lookup, tokenization, authorization, or gateway scenario behavior.

Formula Core

The Luhn check digit is chosen so the completed number has a weighted digit sum divisible by 10. For a partial number without the final check digit, the generator works from right to left, doubles every second digit beginning with the rightmost partial digit, subtracts 9 when doubling produces a two-digit value, and then computes the digit that completes the multiple of 10.

c = (10-(S mod 10)) mod 10
Symbols used in the Luhn check digit formula
Symbol Meaning Practical reading
S Weighted sum of the partial number Computed from the chosen prefix and generated account digits before the final digit is appended.
c Luhn check digit The final digit that makes the completed PAN-shaped number pass the mod-10 check.
Worked checksum path

For the partial number 411111111111111, the weighted sum is 29. The check digit is (10 - (29 mod 10)) mod 10, which gives 1.

The completed number 4111111111111111 passes the checksum. The checksum does not say whether an issuer, customer account, or payment authorization exists.

Bundled Network Rules

The built-in ranges are intentionally practical rather than exhaustive. They cover common test shapes and card-form branches, while custom prefixes handle fixture-specific cases.

Bundled network prefix and length rules
Network Bundled prefixes Default digits Allowed bundled lengths Grouping
Visa 4 16 13, 16, 19 4-4-4-4
American Express 34, 37 15 15 4-6-5
Mastercard 51-55, 2221-2720 16 16 4-4-4-4
Discover 6011, 622126-622925, 644-649, 65 16 16, 19 4-4-4-4
Diners Club 300-305, 36, 38-39 14 14, 16 4-6-4
JCB 3528-3589 16 16, 17, 18, 19 4-4-4-4
Maestro 50, 56-69 16 12 to 19 4-4-4-4
UnionPay 62 16 16, 17, 18, 19 4-4-4-4

Validation Bounds

Generation settings and validation bounds
Setting Accepted range or behavior Effect on the batch
Quantity 1 to 100 Controls how many card rows are created in the next run.
Length override 0 for network default, or 12 to 24 total digits Changes the total number length after prefix and check digit are included.
Custom BIN / IIN Digits only, up to one digit shorter than the target length Accepted when it fits the selected network, unless prefix enforcement is turned off.
Mask trailing digits 0 through the current target length Hides digits in the preview while raw copy actions still use the full generated number.
CVV / CVC style Auto, always 3 digits, or always 4 digits Auto uses 4 digits for American Express and 3 digits for the other bundled networks.
Expiry window 1 to 120 months ahead, with the maximum no earlier than the minimum Creates future MM/YY values when expiry output is enabled.
Seed Up to 64 characters Replays the same batch when the seed and all other settings match.
Unique within batch Capacity is checked before generation Prevents duplicates when the available prefix-and-length space is large enough.

Unseeded runs use browser randomness, so the next batch should be treated as new sample data. Seeded runs are deterministic for the same settings and are better for repeatable test fixtures, but the seed is not a security control and should not be used to create real payment credentials.

Responsible Use Notes:

Generated PAN-shaped values belong in sandbox, demo, documentation, and QA systems. They should not be used to probe live checkout pages, validate stolen data, bypass gateway test-card rules, or represent real customer accounts.

  • Use processor-published test cards or tokens when you need approval, decline, authentication, fraud, or webhook behavior.
  • Do not paste real card numbers into the generator, bug tickets, screenshots, or exported fixture files.
  • Generation runs in the browser session, but exported files and copied rows still contain any synthetic CVV, expiry, and full-number values you choose to include.
  • Masked synthetic previews are useful for demos, but real PAN masking, truncation, tokenization, and storage rules require PCI-aware handling.

Worked Examples:

Checkout form smoke test

Choose the Checkout QA batch profile and keep Quantity at 8. Generated Cards should show Visa rows with 16 digits, Leading digits starting with 4, and no CVV or expiry columns. Generation Metrics should report Luhn validity as All generated rows passed. Use this batch to test formatting, paste behavior, and front-end validation before moving to a gateway sandbox.

Replayable fixture rows

Set Network to Visa, enter 411111 in Custom BIN / IIN, turn on CVV and expiry, set Quantity to 5, and use the seed qa-411111. The Prefix strategy metric should show the custom BIN, and Observed Prefixes should group the rows under 411111. Reusing the same seed and settings later recreates the same fixture rows in the same order.

Prefix mismatch recovery

Set Network to Mastercard, enter 411111 as the custom prefix, and leave Enforce network prefix on. The custom-prefix warning explains that the value does not fit the selected network, and the generated rows fall back to bundled Mastercard prefixes. If the test really needs 411111, switch the network to Visa or turn off prefix enforcement for a form-tolerance test.

Unique-batch capacity warning

Use a 12-digit length with an 11-digit custom prefix, set Quantity to 2, and keep Unique within batch on. Only one final check digit can be appended, so the warning reports that the unique capacity is 1 card. Shortening the custom prefix, increasing the length, lowering quantity to 1, or allowing repeats clears the warning.

FAQ:

Can these numbers make a real charge?

No. The numbers are synthetic and are meant for sandbox, demo, and QA use. Passing the Luhn check only proves a structural checksum, not a real issuer account or authorization path.

Why does Luhn validity pass if the card is not real?

Luhn is a check-digit rule that catches many typing and transcription errors. It does not contact a network, identify an active account, or confirm that a processor will accept the number.

What should I do when a custom BIN falls back?

Check the selected Network and the Enforce network prefix switch. Keep enforcement on for network-shaped QA, switch networks when the prefix belongs elsewhere, or turn enforcement off only for deliberate form-tolerance testing.

How do I create the same batch again?

Use the same Seed and keep every generation setting the same, including network, quantity, custom prefix, length, CVV, expiry, masking, and unique-batch behavior.

Why is the unique batch blocked?

The selected prefix and length may leave too few digit combinations for the requested quantity. The warning gives the current capacity so you can shorten the prefix, increase the length, reduce quantity, or allow repeats.

Glossary:

PAN
Primary Account Number, the full card-number-shaped identifier made from issuer digits, account digits, and a check digit.
IIN
Issuer Identification Number, the standards term for the leading issuer digits in a PAN.
BIN
Bank Identification Number, a common legacy term still used for the leading issuer digits.
Luhn
The mod-10 check-digit rule used by many validators to catch common number-entry errors.
CVV / CVC
Synthetic security-code fields that can be added for sandbox forms requiring a 3- or 4-digit value.
Seed
A replay value that recreates the same generated batch when the other settings match.

References: