An example of how a German IBAN is calculated using an account number and bank code:
Example: Using the account number 123456789 and bank code 50010517, we get the number 500105170123456789131400.
Example: Division of 500105170123456789131400 by 97 leaves a remainder of 57. This number is then subtracted from 98. The result in this case is 41.
Example: For the account number 123456789 and bank code 50010517, we get the IBAN DE41500105170123456789.
For other countries, the check digits are calculated using the same method. However, the bank codes and account numbers might be mapped to different places in the IBAN. Also, the length of the IBAN differs between countries, but it is always the same within one country.
The BIC is usually looked up in a country-specific directory. For instance, German BICs are found in the quarterly-updated directory published by the German Bundesbank.