Card Number Regex Generator
Copy-ready regular expressions for Visa, Mastercard, Amex, Discover and more.
Tool inputs stay in your browser · optional AI search sends your query
Good to know: Regex checks the shape only; always run a Luhn check as well. Strip spaces before matching.
How to use it (step by step)
- 1Fill in the boxes: “Brand”. Example numbers are already there so you can see how it works; replace them with yours.
- 2The result updates instantly as you type (on a phone it is below the boxes).
- 3The bold line is the main answer. Tap Copy next to any value to copy it.
Words to know
- Regex
- A search pattern. For example \d+ finds every number in a text.
- Luhn check
- A quick math test every real card number passes, like a spelling check for numbers. Passing it only means the number is typed in the right shape, not that the card is real.
More in Cards & Payments
Foreign Transaction Fee CalculatorWhat a purchase abroad or in a foreign currency really costs after conversion and card fees.Credit Utilization CalculatorYour credit utilization ratio overall and per card, plus how much to pay to reach a target.Cashback & Rewards CalculatorHow much cashback you earn per month and year after caps and the annual fee.Credit Card Points Value CalculatorWhat your points or miles are worth: value per point and total value of a redemption.Credit Card Annual Fee Break-Even CalculatorHow much you must spend for a rewards card’s annual fee to pay off versus a no-fee card.Credit Card Installment Calculator (Add-On Rate)Monthly amortization, total interest and true effective rate of a card installment plan.