UK sort code and account number explained

Updated 2026-11-25 · by Bob, payments QA engineer

A UK bank account is identified by two numbers: a 6-digit sort code and an 8-digit account number. Together they are enough to receive a domestic payment. For payments from abroad they are packed into a GB IBAN.

Sort code

The sort code is written as three pairs, for example 40-47-84. It identifies the bank and, historically, the branch. The first digits point to the bank group, but after mergers and with digital banks a sort code is not a reliable way to guess the bank: use the details the bank gives you.

Account number

The account number has 8 digits. Some older accounts have 6 or 7 digits: add leading zeros to make 8. A few building societies use a separate roll or reference number: put it in the payment reference.

Where to find your own details

You cannot look up someone else's account number online. Ask the person or company you are paying: it is usually on their invoice.

Modulus check: do the numbers fit together?

Vocalink (Pay.UK) publishes weights for every sort code range. Multiplying the 14 digits by these weights and dividing by 10 or 11 tells you whether the account number can belong to that sort code. Banks and payment forms run this check to catch typos before a payment is sent. A pass does not mean the account exists or is open. Try it with the sort code checker.

Confirmation of Payee

When you add a new payee, most UK banks now check the name you typed against the name on the account and answer “match”, “close match” or “no match”. This is Confirmation of Payee. It protects against fraud and mistakes that a modulus check cannot see.

From sort code to GB IBAN

A UK IBAN has 22 characters:

PartExampleLength
Country codeGB2
Check digits (mod 97)292
Bank code (first 4 letters of the BIC)NWBK4
Sort code6016136
Account number319268198

Result: GB29 NWBK 6016 1331 9268 19 (the standard example from the IBAN registry). You cannot calculate the bank code from the sort code with a formula: get the IBAN from the bank. For test data, use the GB IBAN generator.

UK payment systems in one minute

Test data for developers

Need sort codes and account numbers that pass the modulus check for forms and QA? The UK bank account generator creates them in bulk. They are random: never use them for real payments.

← All guides