Developer Guides
·IdenticAPI

IBAN Validation: Format Check vs Checksum Validation

IBAN format checks vs MOD-97 checksum validation — related but distinct steps. A valid checksum does not prove an account exists.

IBAN validation combines two related but distinct steps: a format check (country code, length, and BBAN structure) and a checksum validation (MOD-97-10 over the full IBAN). Passing one does not imply the other — and passing both still does not prove a bank account exists or accepts payments. Understanding the separation helps you design clearer UX, log the right diagnostics, and choose between client-side pre-checks and the IBAN Validator API.

Why developers conflate format and checksum

Product copy often says "validate IBAN" as a single action. Under the hood, validators typically run:

Input → normalize → format/length rules → MOD-97 checksum → result

Failures at different stages imply different user fixes:

Failure stageTypical user causeUX hint
Format / lengthWrong country, truncated paste"Check country and total length"
ChecksumTransposed digits, typo in check digits"Verify digits — possible typo"
Both passProceed to payment provider (account may still reject)

Logging checksum_valid separately from valid (when your API exposes both) speeds support investigations.

Implementation guide: How to Validate an IBAN Programmatically.

Format check: what it validates

Format validation answers: Does this string look like a valid IBAN for its declared country?

Checks include:

  • Country code present and supported in the validator's scheme table (IdenticAPI covers IBANs from 70+ countries)
  • Total length matches country specification (IBAN lengths vary — there is no universal 34-character rule for all countries)
  • Character set — IBANs use uppercase alphanumeric characters after normalization
  • BBAN structure — some countries enforce fixed patterns within the national segment

Format validation catches:

  • Paste errors that truncate the BBAN
  • Country mismatch (user selected FR but pasted a DE IBAN)
  • Non-IBAN banking identifiers submitted to the wrong field

Format validation does not prove the check digits were calculated correctly. A 22-character DE string with wrong check digits may still pass naive length checks.

Checksum validation: MOD-97 explained

The two check digits after the country code are computed with MOD-97-10 (ISO 13616):

  1. Rearrange: move the first four characters to the end
  2. Expand letters to numbers (A=10, B=11, …, Z=35)
  3. Treat the result as a large integer
  4. Compute modulo 97 — valid IBANs yield remainder 1

Example conceptually with DE89370400440532013000:

  • Rearranged: 370400440532013000 + DE89 → numeric expansion → mod 97 = 1

Single-digit transpositions and many common typos fail MOD-97 even when length and country code appear plausible.

Format-only validation is insufficient

A form that checks only regex shape:

^[A-Z]{2}[0-9]{2}[A-Z0-9]+$

…will accept strings with invalid check digits. Always run MOD-97 before treating an IBAN as validated.

Conversely, a correct checksum on an unsupported length should still fail — country length rules prevent accepting padded or truncated BBANs.

IdenticAPI response fields

The IBAN Validator API returns structured JSON including validation status and checksum outcome:

{
  "iban": "DE89370400440532013000",
  "valid": true,
  "country": "DE",
  "checksum_valid": true
}

Subscribe on RapidAPI and call:

curl -X GET "https://iban-validator3.p.rapidapi.com/validate?iban=DE89370400440532013000" \
  -H "X-RapidAPI-Key: YOUR_RAPIDAPI_KEY" \
  -H "X-RapidAPI-Host: iban-validator3.p.rapidapi.com"

When valid is false, inspect whether format or checksum failed — your integration may map API fields to distinct error messages. When both valid and checksum_valid are true, you have confirmed structural consistency, not account existence.

Format vs checksum: decision table

QuestionFormat checkChecksumBoth required?
Is length correct for country?YesNoYes
Are characters valid?YesNoYes
Are check digits mathematically consistent?NoYesYes
Does account exist at bank?NoNoN/A — use bank/payment APIs
Is account open for SEPA?NoNoN/A

Client-side pre-validation vs API

Teams sometimes implement MOD-97 in browser JavaScript for instant feedback, then confirm server-side via API:

Pros of client MOD-97:

  • Immediate typo detection without round trip
  • Reduced API quota on obvious failures

Cons:

  • Duplicated country table maintenance unless you trust only API validation
  • Client code can be bypassed — always re-validate on the server before payments

Recommended pattern:

Browser: normalize + optional lightweight length check
Server: authoritative IBAN Validator API call
Payment rail: provider account verification

See Validation API vs Building Validation In-House for maintenance tradeoffs on country tables.

Relationship to other validation types

IBAN checksum logic differs from payment card Luhn validation — compare Credit Card Number Validation and Luhn Algorithm Explained. Using the wrong algorithm on the wrong identifier produces false confidence.

For IBAN-like substrings embedded in free text (support tickets, LLM chat), full-text PII & Secrets Detection complements field validators.

Common integration mistakes

  1. Validating once at signup, never on payment submit — users may edit stored IBANs
  2. Storing invalid IBANs when API times out — define fail-closed payment behavior
  3. Showing "account verified" after checksum pass — overstates guarantees; use "IBAN format verified"
  4. Skipping normalization — spaces cause false negatives on strict string equality
  5. Logging full IBAN in plaintext — align with data minimization policy

Testing both stages

Test vectors should include:

  • Valid IBAN with correct checksum (DE89370400440532013000)
  • Same structure with altered check digits (expect checksum failure)
  • Correct checksum on wrong length for country (expect format failure)
  • Normalization cases (spaces, lowercase)

Use synthetic examples only in committed tests.

Summary

  • Format check — country, length, character set, BBAN structure
  • Checksum validation — MOD-97-10 remainder equals 1
  • Neither — confirms account existence, ownership, or available balance

Use the IBAN Validator API for authoritative structural validation across 70+ countries, map failures to actionable UX, and delegate account-level verification to your payment infrastructure.

Frequently asked questions

What is the difference between IBAN format and checksum validation?

Format validation checks country code, total length, character set, and BBAN structure for the declared country. Checksum validation runs MOD-97-10 over the full IBAN. Both are required for structural validity; neither confirms account existence.

Can an IBAN pass format checks but fail checksum?

Yes. Wrong check digits or transposed digits often match length and country rules but fail MOD-97. Always run checksum validation, not regex shape alone.

Does checksum_valid true mean the account is open?

No. A valid checksum only means the IBAN string is structurally consistent. Your payment provider or bank confirms whether the account exists and accepts transfers.

Is IBAN checksum the same as Luhn?

No. IBANs use MOD-97-10. Payment cards use the Luhn mod 10 algorithm. Applying the wrong checksum to an identifier produces false confidence.

Where does IdenticAPI expose checksum results?

The IBAN Validator API response includes valid, country, and checksum_valid fields. Map failures to distinct UX messages when your integration can distinguish format vs checksum errors.

Related reading