UK Bank Account Numbers: How Many Digits, How to Read One, and How to Check It

Reference · November 2026 · 9 min read

Eight digits, always with a six-digit sort code: where the numbers come from, how to read them on a card or cheque, what modulus checking and Confirmation of Payee actually prove, and safe values for test data.

A UK bank account number is eight digits. That one fact answers most of the questions people search for, but the questions behind it are better ones: where the number comes from, why it is always paired with a sort code, what a bank can tell from it, whether it can be checked, and what to do when a number has the wrong number of digits. This guide covers each, with code where it helps.

How many digits?

Eight. Every account number at a UK bank or building society is eight digits, and it is always quoted together with a six-digit sort code, which identifies the bank and branch. The two together identify one account:


Sort code       20-00-00
Account number  55779911

If you see a number with fewer digits, it is almost always an eight-digit number that has lost its leading zeros, usually because a spreadsheet stored it as a number. 00012345 and 12345 are the same account only if you know to pad the shorter one, and a payment system does not know that. Always store account numbers as text, zeros included.

A handful of banks historically issued account numbers of six, seven, nine or ten digits. The UK payments industry publishes rules for converting these to eight for use in the clearing systems, typically by padding with leading zeros or by moving a digit into the sort code. If you meet one of these, confirm the standard eight-digit form with the bank before storing it.

Where the number comes from

Account numbers are issued by the bank. They carry no encoded meaning you can read off: no branch, no account type, no date. Within a bank they are usually sequential or structured according to the bank's own system, which is why two accounts opened at the same branch often have similar numbers, but nothing about that structure is public or stable.

The sort code is the part that carries meaning. The first two digits broadly identify the bank: historically 20 to 29 were Barclays, 30 to 39 Lloyds and Bank of Scotland, 40 to 49 HSBC, 60 to 66 NatWest, and so on. But decades of mergers, acquisitions and new entrants mean the mapping is a guide at best. The authoritative source is the industry's sorting code directory, which lists every live sort code and which payment schemes it can accept. Treat a sort code as an identifier to look up, not one to decode.

How to read bank details on a card, cheque or statement

  • Debit card. The long 16-digit number across the front is the card number, not the account number. The sort code and account number are usually printed on the front or back, labelled, but some banks have moved them off the card entirely for security. Never ask a customer for their card number when you mean their account number.
  • Cheque. The line of numbers along the bottom, printed in magnetic ink, reads cheque number, sort code, account number from left to right. The sort code and account number are also printed in ordinary type near the top right.
  • Statement or banking app. Both are shown explicitly, usually at the top. The app is the most reliable source because it cannot be out of date.

Can an account number be checked?

Yes, up to a point, and the point matters.

Modulus checking tests whether a sort code and account number are consistent with each other. Each of the fourteen digits is multiplied by a weight, the products are added, and the total must divide exactly by 10 or 11. The weights, and which method applies, depend on the sort code, and a published table maps sort code ranges to weights with a list of numbered exceptions. Pay.UK publishes the specification. A pass means the pair is internally consistent; it does not mean the account exists or is open.


// One modulus pass. The weights and modulus come from the published row for this sort code.
function modulusPass(sortCode, accountNumber, weights, modulus) {
  const digits = (sortCode + accountNumber).split('').map(Number);
  const total = digits.reduce((sum, d, i) => sum + d * weights[i], 0);
  return total % modulus === 0;
}

Do not hand-write the table. It changes, the exceptions are where the complexity lives, and a wrong row rejects genuine customers. Use a maintained library or a provider's validation endpoint.

Confirmation of Payee goes further. Since 2020 most UK banks check the name a payer enters against the name on the receiving account before a payment is sent, and return a match, close match or no match. It is the only widely available check that an account exists and belongs to a particular person, and it is performed by the banks, not by a form on your website.

The UK IBAN and bank details checker on this site does the format checks: six digits for the sort code, eight for the account number, the right shape for a BIC, and the full check-digit calculation for an IBAN. It does not do modulus checking, for the reasons above.

The same account as an IBAN

For international payments the sort code and account number are wrapped into a 22-character IBAN:


GB82 WEST 1234 5698 7654 32
│ │  │    │      └──────── account number
│ │  │    └─────────────── sort code
│ │  └──────────────────── four letters from the bank's BIC
│ └─────────────────────── check digits
└───────────────────────── country

Unlike the domestic pair, an IBAN carries check digits you can verify offline, using the same calculation every bank uses. The maths, with code to validate and build one, is in UK sort codes, account numbers, IBANs and SWIFT codes for test data.

Can you tell which bank an account belongs to?

From the sort code, often, by looking it up in the sorting code directory or one of the public lists derived from it. From the account number alone, no. And even the sort code can mislead: challenger banks and some building societies operate under sort codes allocated to a sponsoring bank, and some older sort codes have changed hands.

What the last four digits are for

Forms and statements show the last four digits of an account number as a way to confirm which account is meant without displaying the whole thing. They have no special meaning; they are simply the least sensitive part to show. The same convention applies to card numbers. If you are building a form, showing the last four digits is the usual compromise between confirmation and exposure.

Bank details in test data

A sort code and account number is enough to set up a Direct Debit in someone's name, so real details do not belong in a test database, a fixture file, a screenshot or a demo. Two sources of safe values:

  • Your payment provider's sandbox. Providers that support Bacs Direct Debit or UK bank transfers document test sort codes and account numbers that trigger specific outcomes (success, failure, pending). They are the only values guaranteed to behave predictably end to end.
  • Generated values for form and parser tests. The bank details checker generates sort codes starting 00, a range no UK bank holds, with the bank code TEST and an IBAN whose check digits are correct. They pass every structural check and can never resolve to a real bank.

Pair them with a fictional account holder from the name generator and a fictional address from the UK address generator, and a leaked test database embarrasses nobody.

Quick reference

More guides