Numbers
Test Credit Card BIN Generator
Used by developers, writers, and creators worldwide.
A test credit card BIN generator gives developers and QA engineers structurally valid Bank Identification Numbers without touching live card data. The BIN — the first 6 digits of any payment card — tells a processor which network to route through, which bank issued the card, and what rules apply before a transaction is even authorized. Testing that routing logic requires real-looking prefixes, and using actual BINs in development risks PCI DSS scope creep. This tool generates BINs that follow correct prefix ranges: Visa starting with 4, Mastercard covering 51–55 and 22–27, Amex using 34 or 37, and Discover using 6011 or 65. Choose a specific network or randomize across all four, then set your batch size up to whatever count you need.
Loading usage…
Free forever — no account required
How to use
- Choose your options above
- Click Generate
- Copy your result
Detailed instructions
- Select a card network from the dropdown, or leave it on Random to get a mixed batch across all supported networks.
- Set the count field to the number of BINs you need, from a single sample up to a larger batch for database seeding.
- Click Generate to produce the BIN list instantly, with each result following the correct prefix format for the chosen network.
- Copy individual BINs or the full list, then paste them into your payment integration tests, unit test fixtures, or BIN lookup validation scripts.
Use Cases
- •Seeding a staging Postgres database with multi-network BIN samples for routing logic tests
- •Unit testing card-type detection functions in Jest to confirm Amex 15-digit enforcement triggers correctly
- •Validating that a Stripe or Adyen integration renders the correct network logo in a React checkout form
- •Checking that surcharge or interchange rules fire per network in billing software without using real card data
- •Generating a Discover-only BIN batch to test acceptance-filter logic when a merchant restricts supported networks
Tips
- →When testing card-type detection, generate 20+ BINs on Random and verify your code correctly classifies every single one without hardcoded prefix checks.
- →Amex cards are 15 digits and use a 4-digit CVV — generate Amex BINs separately so you can test those field-length edge cases in isolation.
- →Combine output from this generator with a full test card number tool to build complete 15- or 16-digit numbers that pass Luhn validation.
- →If your gateway charges different fees by network, generate one batch per network and run them through your fee calculation logic to confirm each rule triggers correctly.
- →The 8-digit BIN migration means some processors now read the first 8 digits before the 6. Test both BIN lengths if your integration targets a multi-processor environment.
- →Save a small fixture file of known BINs per network inside your test suite rather than calling a generator dynamically, so tests remain deterministic and fast.
FAQ
are these generated BINs safe to use in a test environment under PCI DSS
Yes. PCI DSS explicitly requires separating test data from production cardholder data, and using non-real BINs satisfies that requirement. These BINs follow correct prefix formats but are not linked to any real issuing bank, so they carry no compliance risk in a dev or QA environment.
can I use a BIN alone to test a Luhn check algorithm
No — a BIN is only 6 digits, and Luhn validation requires a full 15- or 16-digit card number. Pair these BINs with a test card number generator that appends a valid account number and check digit. The BIN prefix will still reflect the correct network, so your routing logic gets realistic input.
what's the difference between a BIN and an IIN
They refer to the same thing: the first 6 (or 8) digits of a payment card. IIN — Issuer Identification Number — is the technically correct ISO 7812 term, but BIN dominates in payment APIs, fraud tooling, and developer docs. Note that the industry is migrating to 8-digit BINs, so confirm which standard your processor supports before testing.