Security Tools

Credit Card & IBAN Validator

Check card numbers with the Luhn algorithm and detect the card brand, batch-validate test numbers, and verify IBANs with the ISO 7064 mod-97 checksum and per-country length rules, with every step shown.

Private by design: anything you enter is processed in your browser only. It is never uploaded to or logged on our servers. Numbers are checked with JavaScript on this page only. Share links never contain card numbers or IBANs you typed, only the published test values listed here.

Spaces and dashes are ignored. Use test numbers, not your real card.

A passing Luhn check only means the number is well-formed. It does not mean the card exists, is active or has funds; only the card issuer can tell you that during an authorization.

Luhn Calculation, Step by Step
Enter a card number to see how the check digit is verified.
Official Test Card Numbers (click to check)

Published by Stripe for sandbox testing (4111 1111 1111 1111 is a long-standing generic Visa test number). Any future expiry date and any CVC work in test mode.

# Number Brand Length Luhn Result

About card number and IBAN validation

The Luhn algorithm (mod 10, ISO/IEC 7812) protects payment card numbers against typing mistakes. Starting from the rightmost digit (the check digit) and moving left, every second digit is doubled; if doubling gives a two-digit number, its digits are added (the same as subtracting 9). The number is valid when the total of all digits is a multiple of 10. Luhn catches every single-digit error and most swaps of adjacent digits, which is why checkout forms run it before sending anything to the payment provider.

The first digits of a card number form the IIN/BIN (Issuer Identification Number), which identifies the network and the issuing bank. Visa numbers start with 4, Mastercard with 51–55 or 2221–2720, American Express with 34 or 37, and so on (see the reference table below). Since 2022 the industry has been moving from 6-digit to 8-digit BINs, so treat brand detection from prefixes as a helpful hint, not an authoritative lookup. A number that passes Luhn and matches a brand can still be cancelled, expired or simply made up.

IBAN (International Bank Account Number, ISO 13616) is used in Europe, the Middle East and parts of Africa and the Americas. It consists of a two-letter country code, two check digits and a country-specific BBAN (Basic Bank Account Number) with a fixed length per country. To validate it, move the first four characters to the end, replace each letter with two digits (A = 10 … Z = 35) and compute the remainder modulo 97 of the resulting large number: a correct IBAN always leaves a remainder of 1 (ISO 7064 MOD 97-10). This detects all single-character errors and nearly all transpositions.

Use this page to test form validation, debug payment integrations with sandbox numbers, or double-check an IBAN before a transfer. Never paste real card data into a website, including this one; everything here runs locally, but test numbers are all you need. To redact card numbers and IBANs from logs before sharing them, use the secrets & PII scrubber. For realistic fake data sets use the mock data generator, and build validation patterns with the regex tester.

Reference Guide

Card brand prefixes (IIN ranges) and lengths used for detection:

BrandStarts withLengthGrouping
Visa413, 16, 194-4-4-4
Mastercard51–55, 2221–2720164-4-4-4
American Express34, 37154-6-5
Discover6011, 644–649, 6516–194-4-4-4
JCB3528–358916–194-4-4-4
Diners Club300–305, 3095, 36, 38–3914–194-6-4 (14 digits)
UnionPay6216–194-4-4-4
Maestro5018, 5020, 5038, 5893, 6304, 6759, 6761–676312–194-4-4-4
Mir2200–220416–194-4-4-4

Some ranges overlap in practice (for example UnionPay 622126–622925 cards are also accepted on the Discover network, and RuPay shares prefixes with Discover), so a BIN database lookup is the only definitive answer.

IBAN lengths by country (SWIFT IBAN Registry):

CountryCodeLengthExample
GermanyDE22DE89 3704 0044 0532 0130 00
United KingdomGB22GB82 WEST 1234 5698 7654 32
FranceFR27FR14 2004 1010 0505 0001 3M02 606
SpainES24ES91 2100 0418 4502 0005 1332
ItalyIT27IT60 X054 2811 1010 0000 0123 456
NetherlandsNL18NL91 ABNA 0417 1643 00
BelgiumBE16BE68 5390 0754 7034
SwitzerlandCH21CH93 0076 2011 6238 5295 7
NorwayNO15NO93 8601 1117 947
Saudi ArabiaSA24SA03 8000 0000 6080 1016 7519
United Arab EmiratesAE23AE07 0331 2345 6789 0123 456
TurkeyTR26TR33 0006 1005 1978 6457 8413 26
BrazilBR29BR18 0036 0305 0000 1000 9795 493C 1

The validator knows the lengths of all registry countries; the shortest IBAN is Norway's (15 characters) and the longest is Saint Lucia's (32). Check digits are always between 02 and 98.

Example input

Card: 4242 4242 4242 4242   → Visa, 16 digits, Luhn sum 80 → valid
IBAN: GB82 WEST 1234 5698 7654 32 → United Kingdom, 22 characters, mod 97 = 1 → valid

This sample loads automatically when you open the tool. Use Load Sample to bring it back.

Frequently Asked Questions

The Luhn algorithm is a checksum used by card numbers to catch typing mistakes. Doubling every second digit from the right and summing the digits must give a multiple of 10.

No. Passing the Luhn check only means the number is well-formed. It says nothing about whether the card exists, is active or has funds.

The first four characters are moved to the end, letters are converted to numbers (A = 10 to Z = 35) and the result must leave a remainder of 1 when divided by 97. The length must also match the country.