iban validator

Validate an International Bank Account Number (IBAN)

Options

Using with form field

The HTML attributes are used to set the validator options via the Declarative plugin

Name HTML attribute Type Description
country data-fv-iban___country String An ISO-3166 country code
message data-fv-iban___message String The error message
sepa data-fv-iban___sepa Boolean Set it to true (false) to indicate that the IBAN number must be (not be) from SEPA countries. The list of SEPA countries are indicated in the table below. By default, this option is not defined

If the country is not defined, it will be parsed from the IBAN number. The validator supports the following countries (sorted by the country code in alphabetical order):

Country Code Sample IBAN Is it valid?
Albania AL AL47212110090000000235698741
Algeria DZ DZ4000400174401001050486
Andorra AD AD1200012030200359100100
Angola AO AO06000600000100037131174
Austria (SEPA) AT AT611904300234573201
Azerbaijan AZ AZ21NABZ00000000137010001944
Bahrain BH BH29BMAG1299123456BH00
Bosnia and Herzegovina BA BA391290079401028494
Belgium (SEPA) BE BE68539007547034
Benin BJ BJ11B00610100400271101192591
Brazil BR BR9700360305000010009795493P1
Bulgaria (SEPA) BG BG80BNBG96611020345678
Burkina Faso BF BF1030134020015400945000643
Burundi BI BI43201011067444
Cameroon CM CM2110003001000500000605306
Cape Verde CV CV64000300004547069110176
Costa Rica CR CR0515202001026284066
Croatia (SEPA) HR HR1210010051863000160
Cyprus (SEPA) CY CY17002001280000001200527600
Czech Republic (SEPA) CZ CZ6508000000192000145399
Denmark (SEPA) DK DK5000400440116243
Dominican Republic DO DO28BAGR00000001212453611324
East Timor TL TL380080012345678910157
Estonia (SEPA) EE EE382200221020145685
Faroe Islands FO FO1464600009692713
Finland (SEPA) FI FI2112345600000785
France (SEPA) FR FR1420041010050500013M02606
Guatemala GT GT82TRAJ01020000001210029690
Georgia GE GE29NB0000000101904917
Germany (SEPA) DE DE89370400440532013000
Gibraltar (SEPA) GI GI75NWBK000000007099453
Greece (SEPA) GR GR1601101250000000012300695
Greenland GL GL8964710001000206
Hungary (SEPA) HU HU42117730161111101800000000
Iceland (SEPA) IS IS140159260076545510730339
Iran IR IR580540105180021273113007
Ireland (SEPA) IE IE29AIBK93115212345678
Israel IL IL620108000000099999999
Italy (SEPA) IT IT60X0542811101000000123456
Ivory Coast CI CI05A00060174100178530011852
Jordan JO JO94CBJO0010000000000131000302
Kazakhstan KZ KZ176010251000042993
Kuwait KW KW74NBOK0000000000001000372151
Latvia (SEPA) LV LV80BANK0000435195001
Lebanon LB LB30099900000001001925579115
Liechtenstein (SEPA) LI LI21088100002324013AA
Lithuania (SEPA) LT LT121000011101001000
Luxembourg (SEPA) LU LU280019400644750000
Macedonia MK MK07300000000042425
Madagascar MG MG4600005030010101914016056
Malta (SEPA) MT MT84MALT011000012345MTLCAST001S
Mauritania MR MR1300012000010000002037372
Mauritius MU MU17BOMM0101101030300200000MUR
Mali ML ML03D00890170001002120000447
Moldova MD MD24AG000225100013104168
Monaco (SEPA) MC MC5813488000010051108001292
Montenegro ME ME25505000012345678951
Mozambique MZ MZ59000100000011834194157
Netherlands (SEPA) NL NL91ABNA0417164300
Norway (SEPA) NO NO9386011117947
Pakistan PK PK24SCBL0000001171495101
Palestine PS PS92PALS000000000400123456702
Poland (SEPA) PL PL27114020040000300201355387
Portugal (SEPA) PT PT50000201231234567890154
Qatar QA QA58DOHB00001234567890ABCDEFG
Republic of Kosovo XK XK051212012345678906
Romania (SEPA) RO RO49AAAA1B31007593840000
San Marino (SEPA) SM SM86U0322509800000000270100
Saudi Arabia SA SA0380000000608010167519
Senegal SN SN12K00100152000025690007542
Serbia RS RS35260005601001611379
Slovakia (SEPA) SK SK3112000000198742637541
Slovenia (SEPA) SI SI56191000000123438
Spain (SEPA) ES ES9121000418450200051332
Sweden (SEPA) SE SE3550000000054910000003
Switzerland (SEPA) CH CH9300762011623852957
Tunisia TN TN5914207207100707129648
Turkey TR TR330006100519786457841326
United Arab Emirates AE AE260211000000230064016
United Kingdom (SEPA) GB GB29NWBK60161331926819
Virgin Islands, British VG VG96VPVG0000012345678901

Using with JavaScript module


// You might need to change the importing path
import iban from 'formvalidation/validators/iban';

const result = iban().validate({
    value: ...,
    options: {
        country: ...,
        message: ...,
        sepa: ...,
    },
});
/*
result is an object of
{
    valid: true or false,
    message: The error message
}
*/

Basic Example

You can click on sample from the table above to see if it's a valid or invalid IBAN.

Module Example

The following snippet shows how to use the iban validator with JavaScript module:


// You might need to change the importing path
import iban from 'formvalidation/validators/iban';

const res1 = iban().validate({
    value: 'AT611904300234573201',
    options: {
        message: 'The value is not a valid IBAN',
    },
});
// res1.valid === true

const res2 = iban().validate({
    value: 'GB29NWBK6016133192681',
    options: {
        message: 'The value is not a valid IBAN',
    },
});
// res2.valid === false

Related validators

The following validators are similar to this one and might be useful to you.

Name Description
bic Validate a BIC (Business Identifier Codes)
creditCard Validate a credit card number
rtn Validate a RTN (Routing transit number)