What Is an IBAN? Structure and How to Validate It (Mod 97)
Updated: November 6, 2026 · AracMerkezi
An IBAN is the number that writes a bank account in one format across country borders, and thanks to its two check digits a typing mistake can be caught before money is sent. A Turkish IBAN starts with TR and is 26 characters long. This guide shows the structure, how the mod 97 check is done by hand, and why an IBAN comes out valid or invalid, using a real calculation; it also measures by scanning what the check catches and what it does not. The example IBANs were generated for teaching purposes and do not belong to a real account.
Turkish IBAN structure
- TR: Country code (2 characters)
- 2 digits: Check digits
- 5 digits: Bank code
- 1 digit: Reserved field (usually 0)
- 16 digits: Account number
Total 2 + 2 + 5 + 1 + 16 = 26 characters. It is written in groups of four characters; grouping is for readability and spaces are not counted. In other countries the length differs:
| Country | Code | IBAN length |
|---|---|---|
| Turkey | TR | 26 |
| Germany | DE | 22 |
| United Kingdom | GB | 22 |
| France | FR | 27 |
| Netherlands | NL | 18 |
| Spain | ES | 24 |
How does mod 97 work?
- Move the first four characters (country code + check digits) to the end.
- Convert letters to numbers: A = 10, B = 11, … Z = 35. Digits stay the same.
- Divide the resulting large number by 97.
- If the remainder is 1, the IBAN is valid in format.
Because the number is very long, this can be done in pieces (appending seven digits at a time and carrying the remainder).
Example 1: Verifying a valid IBAN
Take the IBAN TR61 0000 1000 0000 0000 0000 01, generated for teaching.
- The first four characters move to the end:
0000100000000000000001TR61 - Since
T= 29 andR= 27, the digit string is:0000100000000000000001292761 - Dividing this 28-digit number by 97 leaves a remainder of 1.
- Since the remainder is 1, the IBAN is valid.
Also see how the check digits (61) are found: build the number with the country code and 00 as check digits, then subtract the remainder from 98: 98 − (number mod 97) = 61.
Example 2: A single-digit error
Change the 11th character of the same IBAN: TR610000107000000000000001. Applying the same process, the remainder is not 1; the IBAN comes out invalid. We calculated and verified it with a program: the valid() result is False.
Example 3: Measuring the strength of the check
At every position from the 3rd character to the end of the IBAN above, we scanned all single-digit errors by writing a different digit.
- Errors tried: 216
- Caught: 216 (100%)
Let us also scan swaps of two different adjacent characters:
- Swaps tried: 5
- Caught: 5 (100%)
This shows mod 97 caught all single-digit errors in this scan; the swap scan is a small sample because it contained only 5 different pairs. In general, you should not assume that every transposition-type error will be caught.
Example 4: Dividing the big number in pieces
A calculator may not hold a 28-digit number. The solution is to process the number in seven-digit pieces and put the remainder in front of the next piece at each step. For the example IBAN the steps are: 0000100 mod 97 = 3 → 30000000 mod 97 = 34 → 340000000 mod 97 = 62 → 621292761 mod 97 = 1. The final remainder is 1. The piece-by-piece method and dividing in one go give the same result, because the remainder carries the information of the earlier steps.
What does the check not guarantee?
Mod 97 only shows that the format is consistent. It does not verify:
- That the IBAN really exists
- That the account is active
- Who the account holder is
Before sending money, confirm the recipient's name with the name-verification step in your bank's app and, if possible, with the recipient separately.
When is an IBAN needed?
You write an IBAN to identify the recipient's account when making a bank transfer, an EFT or an international transfer, in standing payment orders, and in recurring payments such as rent or bills. In international transfers, pay particular attention to the country code and length; every country has its own structure and systems check the length first. Confirm fee and timing details with your bank.
Beware of fraud
- Be wary of unexpected messages announcing an IBAN change; confirm the information through a second channel.
- Avoid rushed transfers to people you do not know.
- Do not share your banking details, passwords or verification codes with anyone.
Check it yourself
In Python, for an uppercase IBAN without spaces: int(''.join(str(int(c, 36)) for c in s[4:] + s[:4])) % 97 == 1. This expression does the steps above in one line, with int(c, 36) turning letters into the values 10–35, and it gave the correct result for the two example IBANs above (including the standard example GB82WEST12345698765432).
Common mistakes
- Mixing up zero (0) and the letter O.
- Writing too few or too many digits; for Turkey it must be exactly 26 characters.
- Counting spaces, or picking up an invisible space when copying.
- Using lowercase; most systems convert to uppercase but the check is done in uppercase.
- Assuming an IBAN that passes the check belongs to a real, correct person.
- Copying the recipient's IBAN from a chat message and not confirming it.
- Reusing an IBAN saved from a previous payment without checking; the account may have changed, so confirm the new details with the recipient.
- Skipping a digit when retyping an IBAN from a screenshot; copy and paste if possible.
For a suspected typo, the IBAN Checker tool checks the format, length and check digits; the processing happens in your browser. For similar format checks see the Credit Card Number Check and Barcode / EAN Check tools, and for the card-number logic see the guide Luhn Algorithm.
Note: This article is general information; make the final verification of money transfers with your bank's own steps.
Frequently asked questions
How many characters is a Turkish IBAN?
26 characters: the TR country code, 2 check digits, a 5-digit bank code, 1 reserved digit and a 16-digit account number.
If an IBAN passes the check, is the account real?
No. The mod 97 check only shows the format is consistent; it does not verify that the account exists, is active or whom it belongs to. Confirm the recipient's name with your bank's verification step.
Is it safe to share my IBAN with others?
Sharing it to receive money is normal; an IBAN alone is not enough to withdraw money from an account. But never share passwords, verification codes or card details, and confirm messages asking for an IBAN change through a second channel.
Tools mentioned in this guide
More guides
- How Do You Read a Barcode (EAN-13)? How Is the Check Digit Calculated? – EAN-13 barcode structure, prefix, company and product code, a check digit example, the link to ISBN, and how it differs from the Luhn algorithm.
- What Are Credit Card Numbers and the Luhn Algorithm? Step-by-Step Validation – How is a card number built? Learn the Luhn (mod 10) algorithm with worked examples, what it does and doesn't verify, security warnings and form tips.
- What Is an ISBN? How to Check ISBN-10 and ISBN-13: Check Digit Guide – What is an ISBN and how do you read its 10- and 13-digit form? Check digit math, ISBN-10 to 13 conversion, the EAN-13 link and ISBNs in Turkey.
- How to Calculate Percentages: Six Question Types, Formulas and Examples – Percentage math: percent of a number, what percent one is of another, increase and decrease, percentage points and reverse percentages, with examples.
- How to Calculate VAT: VAT-Inclusive and VAT-Exclusive Formulas and Examples – How do you separate VAT from a VAT-inclusive amount or add it to a VAT-exclusive one? Formulas, a mixed-rate invoice, rounding gaps and shortcuts.
This article is for general information only and is not legal, financial or medical advice. We are not an official institution.