Credit Card Number Generator

Generate valid test card numbers with optional CVV, expiry, and visual card preview.

Credit Card Number Generator

Pick a card type, choose how many you need, and generate valid test cards with optional CVV and expiry.
Each card appears as a visual preview you can copy individually or download as a batch.


Load an example

Generate Cards
Pick a network, choose the card length, and set how many numbers you need.
Options
Numbers are generated locally in your browser. They are Luhn-valid but not linked to any real account. Use them for testing only.
Ready to generate test card numbers.


Overview

This Credit Card Number Generator creates random, Luhn-valid test card numbers for popular payment networks. Each generated number follows the correct prefix and digit-length rules for its network, includes an optional CVV/security code and future expiry date, and is displayed as a realistic visual card preview. It is built for developers, QA engineers, and anyone testing checkout forms, payment validators, or sandbox payment gateways.

What it does: Choose a network, set a quantity (up to 12 cards at a time), optionally enter a custom BIN/IIN prefix, and generate numbers that pass the Luhn check digit test. The output is a set of visual cards showing the network logo, formatted number, CVV, and expiry. You can copy any single card or download the whole batch as a text file.

Why it is useful: Real card numbers must never be used for testing. This tool gives you structurally valid numbers that behave like real cards in form validation, masking, display formatting, and length checks, without touching any live payment data. It is safe, private, and runs entirely in your browser.

What it is built with: The generator uses the ISO/IEC 7812 issuer identification number (IIN) prefix ranges for each supported network, the Luhn algorithm to compute the check digit, and standard JavaScript in the browser. Nothing is sent to a server, and no account is required.


What this Tool Does

The generator produces numbers that look and behave like real payment cards for testing purposes. It does not create live accounts, check balances, or verify identity. Every output is syntactically correct: the prefix belongs to the chosen network, the total length is valid for that network, and the final digit satisfies the Luhn check.

1. Pick a network and length: Choose one of the eight supported networks from the dropdown. The length list updates automatically to show only the valid digit counts for that network, so you never generate a number with the wrong size.

2. Set quantity and options: Enter how many cards you need, up to 12 at a time. Optionally enter a custom BIN/IIN prefix to test a specific range, toggle CVV/CVC and expiry on or off, and set a cardholder name that appears on every generated card.

3. Generate: Click "Generate Cards". Each card is assembled with a valid network prefix, random middle digits, and a correctly computed Luhn check digit. The visual preview shows the network color, logo, formatted number, and the optional fields you selected.

4. Copy or download: Copy a single card number from its card, copy all cards at once, or download the batch as a tab-separated text file. Use the numbers in checkout forms, QA scripts, or test gateways — never for real payments.


Features

Multiple networks: Generate numbers for Visa, Mastercard, American Express, Discover, JCB, Diners Club, UnionPay, and Maestro. Each network uses its own valid length and prefix rules.

Batch generation: Generate between 1 and 12 cards at once. The visual card grid updates instantly so you can review all numbers side by side.

Custom BIN / IIN: Enter a specific leading-digit sequence to test a particular BIN range. The generator respects the length and appends a correct Luhn check digit.

CVV / CVC and expiry: Toggle optional 3- or 4-digit security codes and future expiry dates on or off depending on what your test form requires.

Visual card preview: Each card is rendered with the network logo, a chip icon, the formatted number, a cardholder placeholder, and the optional CVV and expiry fields.

Copy and download: Copy any single card number or the whole batch to your clipboard. Download all cards as a tab-separated text file for QA reports or import into test data sets.


Examples

Click "Try it" to load an example configuration and generate cards.

1. Four Visa cards for checkout QA

A typical checkout batch: 16-digit Visa numbers with CVV and expiry fields included.

Input
Network: Visa
Length: 16
How many: 4
Custom BIN: (blank)
Include CVV: on
Include Expiry: on
Output
Card 1: 4571 2191 1303 5643  CVV: 842  Expiry: 03/27
Card 2: 4539 1488 0343 6867  CVV: 219  Expiry: 11/26
Card 3: 4916 1234 5678 9012  CVV: 573  Expiry: 07/28
Card 4: 4556 7372 1351 0089  CVV: 401  Expiry: 01/27

2. Two American Express cards with 4-digit CID

Amex uses 15-digit numbers and a 4-digit CID. The visual preview shows the 4-6-5 grouping.

Input
Network: American Express
Length: 15
How many: 2
Custom BIN: (blank)
Include CVV: on
Include Expiry: on
Output
Card 1: 3403 755079 21638  CID: 4821  Expiry: 09/27
Card 2: 3742 454887 62014  CID: 7390  Expiry: 05/26

3. Mastercard with a custom BIN prefix

Testing a specific BIN range by entering 2221 as a custom prefix. The remaining digits are filled automatically.

Input
Network: Mastercard
Length: 16
How many: 3
Custom BIN: 2221
Include CVV: on
Include Expiry: off
Output
Card 1: 2221 4805 1923 6742  CVC: 582
Card 2: 2221 1394 7762 0085  CVC: 917
Card 3: 2221 6582 9041 3356  CVC: 244

FAQs

FAQ 1: Are these real credit card numbers?
Answer: No. They are synthetically generated test numbers that follow the correct structure and pass the Luhn check, but they are not linked to any real account, bank, or payment processor.

FAQ 2: Can I use these numbers to buy something online?
Answer: No. Payment processors and merchants will reject them because they are not associated with real funding sources or identities. Use them only for testing software.

FAQ 3: Does "Valid" mean the card will be approved?
Answer: No. The generator only ensures the number is structurally correct. Approval depends on the issuing bank, available funds, and other checks that this tool does not perform.

FAQ 4: What is a custom BIN / IIN?
Answer: The BIN (Bank Identification Number) or IIN is the leading part of a card number. Some tests need a specific prefix to exercise a particular issuer range. Entering a custom BIN tells the generator to start the number with those digits.

FAQ 5: Is it safe to generate cards here?
Answer: Yes. Everything runs locally in your browser. No numbers are sent to a server, stored, or shared with anyone.

FAQ 6: Why does American Express show 4-digit CVV?
Answer: Amex uses a 4-digit CID (Card Identification Number) instead of the 3-digit CVV used by most other networks. The generator follows that convention automatically.


Tools Worth Trying

TextToolz

The Ultimate Text Tools

TextToolz works seamlessly to let you convert and design your text. It is fast, reliable and secure. Trusted by thousands of users.