Credit Card Validator
Validate a card number with the Luhn algorithm and identify the issuing network from its prefix. Runs locally, nothing is transmitted.
Need this done properly for your business?
Radiatus delivers secure cloud, DevOps & compliance engineering.
What the Luhn check actually proves
The Luhn algorithm is a checksum designed in the 1950s to catch transcription errors: a mistyped digit or two adjacent digits transposed. It works by doubling every second digit from the right, subtracting 9 from any result above 9, summing everything, and checking the total is divisible by 10.
It proves only that the number is well-formed. It says nothing about whether the card exists, whether the account is open, whether there are funds, or whether the person entering it is the cardholder. Any number can be constructed to pass. Its single legitimate use is client-side input validation, catching a typo before a payment request is sent.
Identifying the network
The first digits, the Issuer Identification Number, indicate the network. Visa begins with 4. Mastercard uses 51 to 55 and the newer 2221 to 2720 range. American Express uses 34 and 37 and has 15 digits rather than 16. Discover uses 6011, 644 to 649 and 65. UnionPay uses 62. Length varies by network, so a length check alongside the prefix catches more errors than either alone.
Never store or transmit card numbers
This is the part that matters. PCI DSS applies to any system that stores, processes or transmits cardholder data, and the compliance burden is substantial. The correct architecture is that the number never touches your server at all: use a payment provider's hosted fields or iframe so the data goes directly from the browser to the processor, and your system only ever sees a token. Storing the CVV after authorisation is prohibited outright under any circumstances.
Test numbers are published
Every payment processor publishes test card numbers that pass Luhn and trigger specific responses in their sandbox. Use those for development. Never use a real card number as test data, and never paste one into a validator you do not control.
Local validation
This tool runs entirely in your browser. Nothing is transmitted, logged or stored, which is the only acceptable design for anything touching a card number.
Frequently Asked Questions
Privacy & Security
Validation happens 100% in browser. No data sent.
About This Tool
This tool runs entirely in your browser. No data is sent to any server, ensuring complete privacy. Simply use the interface above to get started — no registration or login required.
Disclaimer: This tool is provided "as is" without warranty of any kind. Results are for educational and utility purposes.
Related Tools
User Agent Parser
UtilityParse a User-Agent string into browser, engine, operating system and device. Explains why UA strings are unreliable and what to use instead.
QR Code Generator
UtilityGenerate QR codes for URLs, text, Wi-Fi and contact details. Adjustable error correction and size, produced entirely in your browser.
Text Case Converter
UtilityConvert text between camelCase, PascalCase, snake_case, kebab-case, CONSTANT_CASE, Title Case and sentence case. Runs entirely in your browser.