A UK IBAN is 22 characters long and contains the sort code and account number unchanged: GB, two check digits, four letters identifying the bank, the six-digit sort code, then the eight-digit account number. If you know a UK account's sort code and account number, the only parts you cannot read off a cheque are the four letters (they come from the bank's BIC) and the check digits (a MOD 97 calculation). This post goes through the mapping with real published examples, explains what UK domestic payments use instead of the IBAN, and describes the two checks that people often confuse with IBAN validation: Confirmation of Payee and modulus checking.
The GB layout, position by position
The SWIFT IBAN registry defines the United Kingdom entry as GB2!n4!a6!n8!n: a fixed 22 characters, with the bank identifier in BBAN positions 1 to 4 (letters only) and the branch identifier in positions 5 to 10. The registry's own example is GB29 NWBK 6016 1331 9268 19.
| Positions | Length | Content | Example |
|---|---|---|---|
| 1 to 2 | 2 letters | Country code | GB |
| 3 to 4 | 2 digits | IBAN check digits (MOD 97-10) | 29 |
| 5 to 8 | 4 letters | Bank identifier, the first four characters of the bank's BIC | NWBK |
| 9 to 14 | 6 digits | Sort code | 601613 (printed as 60-16-13) |
| 15 to 22 | 8 digits | Account number | 31926819 |
Two consequences for anyone writing validation code. A UK IBAN always has letters in positions 5 to 8, so a pattern that expects digits after the check digits rejects every one of them. And the BBAN has no national check digit of its own: the registry layout is bank, branch, account, nothing else. Ireland uses exactly the same layout (IE + check digits + four letters + six-digit sort code + eight-digit account), which is why the two are easy to mix up in test data; the https://generaterandomiban.com/en/iban-generator/ie/ireland page shows the Irish version.
From sort code and account number to IBAN
HMRC publishes both forms of its Corporation Tax accounts on GOV.UK, which makes a clean worked example. For HMRC Cumbernauld the UK details are sort code 08 32 10 and account number 12001039; for payments from abroad the page gives the IBAN GB62 BARC 2011 4770 2976 90 and the BIC BARCGB22. Reading the IBAN against the table:
BARCis the bank identifier, matching the first four characters ofBARCGB22.201147is the sort code 20-11-47, a Barclays sort code.70297690is the account number.
The domestic account (08-32-10 / 12001039) and the international one are different accounts at different banks: HMRC publishes a Barclays account for overseas payers. So a UK organisation's IBAN does not always wrap the sort code and account number you have on file for it, and you should take the IBAN the payee gives you rather than build one.
For the check digits, the calculation is the standard one: write GB00 + BBAN, move the first four characters to the end (BARC20114770297690GB00), replace letters with numbers (B = 11, A = 10, R = 27, C = 12, G = 16), which gives 1110271220114770297690161100, divide by 97. The remainder is 36, and 98 minus 36 is 62. https://generaterandomiban.com/en/blog/iban-validation-python-php-java walks through the arithmetic and gives code.
A second published pair, from the MHRA's bank details on GOV.UK (a 2015 notice): sort code 60-70-80, account number 10004386, IBAN GB68NWBK60708010004386, SWIFT code NWBKGB2L. Same pattern: NWBK from the BIC, 607080 is the sort code, 10004386 the account number, and 98 minus the remainder (30) gives 68.
Where the four letters come from
The bank identifier is the first four characters of the bank's BIC, the business party prefix. NatWest's BIC starts NWBK, Barclays' BARC, HSBC UK's MIDL, Santander UK's ABBY, Nationwide's NAIA. These are not derived from the sort code, and you cannot compute them: the account-holding bank assigns them when it issues the IBAN, and a validator can only look them up. (The industry's reference for sort codes is the Extended Industry Sort Code Directory, published by Vocalink, which covers the institutions taking part in Bacs, CHAPS, cheque clearing and Faster Payments.)
The UK IBAN embeds a fragment of the BIC, but it is still an account identifier, while the BIC identifies the institution in payment messages (https://generaterandomiban.com/en/ibanpedia/iban-vs-bic covers the distinction). UK banks give customers both, and international payment forms ask for both.
Domestic payments still run on sort code and account number
Inside the UK, the IBAN is rarely used. Bacs, the Faster Payment System and the Image Clearing System route and settle payments on the sort code, which Pay.UK describes as integral to those systems and whose rules it manages for the industry. CHAPS payments and standing orders are set up with the same two numbers. A UK customer asked for an IBAN in a domestic payment form will usually not know it without looking at a statement.
The IBAN appears when money crosses a border: a euro payment from the EU, or a transfer from any country whose banks ask for an IBAN. The UK stayed in SEPA after leaving the EU, by a decision of the European Payments Council in 2019, as a non-EEA SEPA country. That means a GB IBAN works in a SEPA Credit Transfer, but the "IBAN only" rule of Regulation (EU) 260/2012, which stops EEA banks from demanding a BIC, binds EEA providers, not UK ones; a payment to or from the UK may still require the BIC alongside the IBAN. https://generaterandomiban.com/en/ibanpedia/iban-and-sepa has the detail. GB IBANs are also used in Jersey, Guernsey and the Isle of Man, which share the GB registry entry.
So a form that serves UK customers for UK payments should ask for sort code and account number, and a form for international payers should ask for the IBAN and, for the UK, the BIC.
Confirmation of Payee, in brief
Confirmation of Payee (CoP) is the UK's account-name check. When a payer sets up a new payee, their bank sends the name, sort code and account number (and whether the account is personal or business) to the payee's bank, which answers whether the name matches, is a close match, or does not match. The Payment Systems Regulator required the six largest banking groups to implement it by March 2020 (Specific Direction 10) and extended it to most other providers in two groups, by 31 October 2023 and 31 October 2024 (Specific Direction 17), so that nearly all Faster Payments and CHAPS payments are covered.
Two things follow for developers. CoP works on the sort code and account number, not on the IBAN, and Pay.UK describes it as an API-based peer-to-peer service between payment providers, so a business reaches it through its own provider rather than through a public endpoint. And it is independent of IBAN validity: an IBAN can pass every structural check and the payment can still come back "no match" because the name is wrong. The earlier post https://generaterandomiban.com/en/blog/valid-iban-payment-rejected covers the other reasons a correct IBAN gets rejected.
Modulus checking: the domestic check that is not in the IBAN
The IBAN check digits tell you the 22 characters were copied correctly. They do not tell you whether the account number belongs with the sort code. UK banks have a separate test for that, called modulus checking, specified in the Vocalink document "Validating account numbers: UK modulus checking" (version 9.00, July 2026), published for organisations that submit Bacs Direct Credits and Direct Debits so they can catch bad details before a payment is sent.
The method, in outline:
- Write the sort code and account number as one 14-digit string (the specification labels the positions
u v w x y zfor the sort code anda b c d e f g hfor the account number). - Look the sort code up in the weight table (
VALACDOS.txt), which gives, per sort code range, the algorithm to apply and the 14 weights. Three algorithms exist: standard modulus 10, standard modulus 11 and double alternate (which uses modulus 10 after doubling alternate digits). - Multiply each digit by its weight, sum, and test the total against the modulus. Some sort codes require two checks; some have none.
- Apply the exceptions. There are 14 of them, flagged per sort code range: altered weights for certain accounts, a second check that passes if either succeeds, and a sort code substitution table (
SCSUBTAB.txt) for one range of sort codes. The document also says how to standardise non-standard account numbers first, for example ten-digit NatWest numbers use the last eight digits and Leeds Building Society's the first eight.
The document ends with a chapter of test cases with expected results, which is the right starting point if you implement it. A few points to keep straight:
- Modulus checking is arithmetic on the two numbers. Passing it means the pair is well formed under that bank's rules, not that the account exists or is open.
- It is a UK domestic check. It is not part of ISO 13616 and no IBAN validator performs it. A GB IBAN with valid check digits can wrap a sort code and account number that fail modulus checking.
- It is not a substitute for Confirmation of Payee, and vice versa. One checks the numbers against each other, the other checks the name against the account.
If your system stores UK accounts as sort code plus account number, running modulus checking at entry time is cheap and catches many transcription errors. If it stores IBANs, you can still run it on positions 9 to 22.
Test data for GB IBANs
For tests you need GB IBANs that pass structural validation, look like real ones, and are not anyone's account. Three sources, in order of realism:
- The registry example,
GB29 NWBK 6016 1331 9268 19. Valid by definition and widely recognised, which also makes it a poor choice when you want to be sure your code is not special-casing a famous string. - Realistic generated IBANs. This site's generator uses, for the UK, a real bank identifier and a real sort code of that bank (NatWest 60-70-80, Barclays 20-11-47, HSBC 40-42-46, Santander 09-00-99, Nationwide 07-01-16, Monzo 04-00-04, Starling 60-83-71, taken from the banks' own pages and GOV.UK), with a random account number and correct IBAN check digits. For example
GB23 NWBK 6070 8039 7249 29orGB38 MIDL 4042 4638 4771 05. They pass every IBAN check and are useful for testing the mapping in this post. The account numbers are random, so they are not expected to pass modulus checking, and the IBANs were not issued by any bank. - Fully random IBANs. With realistic mode switched off the four letters are random too (
GB87 ETDU 6925 6292 8231 20). Structurally valid, butETDUis not a bank, which is useful when you want to prove that your code does not look the bank identifier up.
Cases worth covering for a UK form or parser:
- Lowercase and spaces on input (
gb29 nwbk 6016 1331 9268 19) normalise to the electronic form. - Length: 22 exactly.
- Letters in positions 5 to 8, digits everywhere else after position 4.
GB29 NWB1 …must fail. - Sort code at positions 9 to 14, shown as
60-16-13to UK users; account number at positions 15 to 22, kept as a string because a leading zero is part of it. - Round trip: build the IBAN from bank identifier + sort code + account number, compute the check digits, validate, and compare with the published pairs above.
- Rejections that have nothing to do with structure, such as a CoP "no match" or a closed account, come from the payment provider, so mock them at that boundary.
Sources
- SWIFT IBAN Registry, Release 102 (June 2026): the United Kingdom entry (
GB2!n4!a6!n8!n, bank and branch identifier positions, example IBAN). - ISO 13616-1:2020: IBAN structure and the MOD 97-10 check digits.
- GOV.UK, Pay your Corporation Tax bill: bank details: HMRC's published sort codes, account numbers, IBANs and BIC.
- GOV.UK, Changes to MHRA bank details: a published NatWest sort code, account number, IBAN and BIC pair.
- Pay.UK, Sort code information: the role of the sort code in Bacs, FPS and ICS and Pay.UK's responsibility for it.
- Pay.UK, Confirmation of Payee: what the service checks and its scale.
- Payment Systems Regulator, Confirmation of Payee: outcomes, Specific Directions 10 and 17, deadlines, coverage of Faster Payments and CHAPS.
- Vocalink, Validating account numbers: UK modulus checking, version 9.00 (July 2026), and the modulus checking tools page: methods, weight table, substitution table, exceptions and test cases.
- European Payments Council: EPC List of SEPA Scheme Countries (EPC409-09), the UK's status as a non-EEA SEPA country.
- Regulation (EU) No 260/2012: the IBAN-only requirement for payment service providers in the Union.