Iban validate
iban-validate · version 1.0.0 · Identifiers & check digits · free, no key needed
Validate an IBAN's country, registry length, BBAN structure and MOD 97-10 check digits, and parse its bank/branch code.
Use when you need to: validate an iban · check if this bank account number is a valid iban · parse bank code and branch code from an iban.
Decide before calling
Read the versioned contract and the supported scope below. Reuse iban-validate@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.
Explain the choice
"I can use iban-validate@1.0.0 for validate an iban. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."
Supported
- validate an iban
- check if this bank account number is a valid iban
- parse bank code and branch code from an iban
- is this iban's check digit correct
- verify an international bank account number
- בדיקת תקינות מספר חשבון בנק בינלאומי
Not supported
- computing an IBAN from a domestic BBAN (use iban-compute-from-bban)
- looking up the bank name or address from the bank code
- countries not in the pinned IBAN registry (returns unsupported as unknown_country, never a guess)
- BIC/SWIFT validation (use bic-validate)
Behavior
- electronic = iban with every ASCII space removed, then every ASCII a-z upper-cased to A-Z (no other case folding, no locale). print = electronic split into groups of 4 Unicode code points (so a surrogate pair is never split) joined by a single space. Both are always returned.
- shape_ok = electronic matches ^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$; otherwise valid:false, reason:"invalid_character" with country/check_digits/bban/bank_code/branch_code null.
- Otherwise country = electronic[0:2], check_digits = electronic[2:4], bban = electronic[4:]. If the pinned IBAN registry (getIbanSpec) has no entry for country, valid:false, reason:"unknown_country".
- If electronic.length does not equal the registry length for country, valid:false, reason:"wrong_length". If bban does not match the registry BBAN notation, valid:false, reason:"bban_format".
- Otherwise bank_code/branch_code are sliced from bban per the registry (null when the country has no such field). MOD 97-10 check: rearranged = bban + country + check_digits; digits = alnum_to_digits(rearranged) (letters expand to charValue 10-35). If digits mod 97 != 1, valid:false, reason:"check_digits_mismatch" (bank_code/branch_code populated). Otherwise valid:true, reason:null.
- data_version is always the pinned IBAN registry version, on every path. Pure string parsing and arbitrary-length MOD 97 arithmetic; no locale, clock, or randomness.
Input
iban(string, required): min length 1; max length 60
Output
valid(boolean, required)reason(one of null, "invalid_character", "unknown_country", "wrong_length", "bban_format", "check_digits_mismatch", required)country(string or null, required): pattern^[A-Z]{2}$check_digits(string or null, required): pattern^[0-9]{2}$bban(string or null, required): min length 1; max length 30bank_code(string or null, required)branch_code(string or null, required)electronic(string, required): min length 1; max length 60print(string, required): min length 1; max length 75data_version(string, required)
Limits
- max iban bytes: 60
Example
Request input:
{
"iban": "GB29NWBK60161331926819"
}
Response:
{
"result": {
"electronic": "GB29NWBK60161331926819",
"print": "GB29 NWBK 6016 1331 9268 19",
"data_version": "swift-iban-registry-103-2026-09.subset-80",
"valid": true,
"reason": null,
"country": "GB",
"check_digits": "29",
"bban": "NWBK60161331926819",
"bank_code": "NWBK",
"branch_code": "601613"
}
}
How to call it
MCP
Connect https://computefirst.net/mcp (setup), then call execute with:
{
"id": "iban-validate",
"version": "1.0.0",
"input": {
"iban": "GB29NWBK60161331926819"
}
}
HTTP (no key)
curl -X POST https://computefirst.net/v1/tools/iban-validate/versions/1.0.0/execute \
-H "Content-Type: application/json" \
-d '{"iban":"GB29NWBK60161331926819"}'
The machine-readable contract is at /v1/tools/iban-validate/versions/1.0.0.
CLI
node cli.mjs run iban-validate 1.0.0 --input input.json --base-url https://computefirst.net
Get the client at /clients/cli/.
Related tools
- Bic validate: Validate a Business Identifier Code's ISO 9362:2022 structure and parse its party prefix, country, location and branch.
- Isin validate: Validate a 12-character ISIN's ISO 6166 Luhn check digit and parse its country prefix, NSIN and NSIN scheme.
- Iban compute from bban: Compute the MOD 97-10 check digits and full IBAN for a country code and BBAN, using the pinned IBAN registry.
- Iccid validate: Validate a 19/20-digit ICCID's Luhn check digit, require the 89 major industry id, split issuer/account digits.
- Imei validate: Validate a 15-digit IMEI's Luhn check digit or accept a 16-digit IMEISV, and split the TAC from the serial.
- Iso6346 container validate: Validate an 11-character ISO 6346 container number's mod-11 check digit and split the owner code, category and serial.