IBAN Validation Beyond MOD-97, Bank Name, BIC, and SEPA Check
MOD-97 is not enough
Most IBAN validation libraries only check the MOD-97 checksum. That catches typos but misses a lot:
- A valid checksum doesn't mean the country code is correct
- It doesn't tell you the bank name or BIC
- It doesn't tell you if the account supports SEPA payments
- It doesn't verify the IBAN length matches the country's standard
Proper IBAN validation requires multiple checks in sequence.
What a complete validation looks like
import httpx
response = httpx.get(
"https://frenchbusinessapi.com/iban/validate/FR7630006000011234567890189",
headers={"X-API-Key": "your_api_key"}
)
data = response.json()
print(data)
Response:
{
"valid": true,
"iban": "FR7630006000011234567890189",
"country_code": "FR",
"country_name": "France",
"check_digits": "76",
"bban": "30006000011234567890189",
"bank_code": "30006",
"bank_name": "BNP PARIBAS",
"bic": "BNPAFRPP",
"sepa_member": true,
"sepa_instant": true,
"iban_length_valid": true,
"checksum_valid": true
}
One call gives you: checksum validation, length check, bank identification, BIC code, and SEPA support, including whether SEPA Instant is available.
The validation pipeline
Here's what happens behind the scenes when you validate an IBAN:
Step 1, Format check: is it well-formed? Letters in the right places, digits where expected, minimum length.
Step 2, Country code: is the two-letter prefix a valid ISO 3166-1 country code that uses IBANs?
Step 3, Length check: each country has a fixed IBAN length. France is 27 characters, Germany is 22, UK is 22. A French IBAN with 25 characters is invalid even if the checksum works.
Step 4, MOD-97 checksum: move the first 4 characters to the end, convert letters to numbers (A=10, B=11...), compute modulo 97. Result must be 1.
Step 5, Bank identification: extract the bank code from the BBAN (the part after the country and check digits) and look it up against known bank registries.
Step 6, BIC resolution: map the bank code to its SWIFT/BIC identifier. The API maintains a directory of 112+ European bank BICs.
Step 7, SEPA check: is this bank in a SEPA country? Does it support SEPA Credit Transfer? SEPA Direct Debit? SEPA Instant?
76 countries supported
IBANs are not just European. The standard is used in 76+ countries including:
- All 27 EU member states
- UK, Switzerland, Norway, Iceland
- Turkey, Israel, UAE, Saudi Arabia
- Brazil, Pakistan, Kazakhstan
The API validates all of them, with country-specific length checks and bank code extraction.
Use case: pre-payment validation
Before you generate a SEPA XML payment file, validate every IBAN in the batch. A single invalid IBAN can cause the bank to reject the entire file:
ibans = ["FR7630006000011234567890189", "DE89370400440532013000", "INVALID123"]
for iban in ibans:
r = httpx.get(
f"https://frenchbusinessapi.com/iban/validate/{iban}",
headers={"X-API-Key": "your_api_key"}
)
d = r.json()
if d["valid"]:
print(f"{iban}: {d['bank_name']} ({d['bic']}), SEPA: {d['sepa_member']}")
else:
print(f"{iban}: INVALID")
Use case: auto-fill bank details
When a user enters their IBAN in a form, you can auto-fill the bank name and BIC:
// Frontend JavaScript
const response = await fetch(
`https://frenchbusinessapi.com/iban/validate/${iban}`,
{ headers: { "X-API-Key": apiKey } }
);
const data = await response.json();
if (data.valid) {
document.getElementById("bank-name").value = data.bank_name;
document.getElementById("bic").value = data.bic;
}
This improves UX and reduces errors, the user doesn't need to look up their BIC separately.
Common pitfalls
- Spaces are fine: "FR76 3000 6000 0112 3456 7890 189" is valid. The API strips spaces automatically.
- Lowercase is fine: "fr7630006000011234567890189" works.
- Don't confuse IBAN and account number: an IBAN includes the country code, check digits, and bank code. A raw account number is not an IBAN.
- BIC is not always 8 characters: BICs can be 8 or 11 characters. The 11-character version includes a branch code.
- SEPA membership ≠ euro: SEPA includes non-euro countries (Sweden, Romania, Bulgaria). They can send/receive SEPA payments in euros.
Next steps
- Get your free API key, 100 requests/day
- API documentation
- Related: Generate SEPA XML, Validate EU VAT, French company lookup
Ready to build for Europe?
One API for company lookup, VAT validation, IBAN verification, SEPA payments, and more.
Get your API key