A sort code is a 6-digit number used by banks in the United Kingdom and Ireland to identify specific bank branches for domestic payments. It serves a similar purpose to routing numbers in the United States — it tells the payment system which bank and branch should receive the funds. Sort codes are a foundational element of the UK banking infrastructure and have been in use for decades, underpinning every domestic bank transfer, Direct Debit, standing order, and salary payment processed through the British financial system.
Sort codes were introduced in the 1960s as part of a broader effort to automate the UK banking system. Before their introduction, clearing cheques was a labour-intensive manual process. Bank clerks had to physically sort paper cheques by hand, routing them to the correct branch — a process that could take several days. In 1968, the Bankers' Automated Clearing Services (BACS) was established to bring electronic processing to the UK payments landscape. BACS needed a standardised numerical system to identify banks and branches, and the 6-digit sort code was born.
The pre-decimal era of British banking relied heavily on manual ledger entries and paper-based clearing. When decimalisation occurred in 1971, the banking industry accelerated its adoption of computer systems. The sort code system dovetailed neatly with this modernisation, providing a compact, machine-readable identifier for every bank branch in the country. Over the following decades, sort codes became embedded in every UK payment system, from the original BACS network through to the Pay.UK systems that operate today.
A sort code is written as three pairs of digits separated by hyphens:
The first two digits typically identify the bank. For example, sort codes starting with 20 belong to Barclays, those starting with 60 belong to NatWest, and those starting with 09 belong to Santander UK. The remaining four digits narrow down to the specific branch or processing centre. This hierarchical structure means that a single glance at the first pair of digits can tell you which bank the sort code belongs to, while the full 6-digit code pinpoints the exact branch.
The format is always XX-XX-XX when displayed to customers, though payment systems process it as a continuous 6-digit string without hyphens. Whether you enter it with or without hyphens, our sort code validator will accept both formats and validate it correctly.
While the full sort code directory contains thousands of entries, knowing the common bank prefixes is useful for quickly identifying which institution a sort code belongs to. Here are the most widely-recognised ranges:
| Prefix | Bank | Notes |
|---|---|---|
| 20-xx-xx | Barclays | One of the largest UK branch networks |
| 30-xx-xx | Lloyds Bank | Also covers some Halifax accounts |
| 40-xx-xx | HSBC | UK's largest international bank |
| 60-xx-xx | NatWest | Part of NatWest Group (formerly RBS) |
| 09-xx-xx | Santander UK | Formerly Abbey National / Alliance & Leicester |
| 83-xx-xx | Royal Bank of Scotland | NatWest Group, primarily Scottish branches |
| 80-xx-xx | Bank of Scotland | Part of Lloyds Banking Group |
Note that these ranges are approximate guides. Over the years, bank mergers and acquisitions have led to some overlap. For example, Halifax (now part of Lloyds Banking Group) may use sort codes in ranges different from the standard Lloyds 30-xx-xx prefix. Always use a sort code lookup tool to confirm the exact bank and branch.
Sort codes are central to every major UK payment system. Understanding how each system uses them helps clarify why the sort code is so important. These systems are now overseen by Pay.UK, the operator of the UK's retail interbank payment systems.
Launched in 2008, Faster Payments enables near-instant bank transfers between UK accounts. When you send a Faster Payment, the system uses the recipient's sort code to route the transaction to the correct bank. Most transfers complete within seconds, and the system operates 24 hours a day, 365 days a year. The sort code and account number pair is the minimum information required to send a Faster Payment.
Bacs is the workhorse of UK payments. It handles Direct Debits (for bill payments, subscriptions, and memberships) and Direct Credits (for salaries, pensions, and benefit payments). When your employer pays your salary, they submit a Bacs file containing your sort code and account number. Bacs payments take three working days to clear: day one for submission, day two for processing, and day three for settlement. In 2023, Bacs processed over 4.5 billion payments.
The Clearing House Automated Payment System (CHAPS) handles high-value, same-day payments. It is commonly used for property purchases, large business transactions, and other time-critical transfers. CHAPS is operated by the Bank of England and uses sort codes to route payments just like Faster Payments and Bacs. Because CHAPS provides irrevocable, same-day settlement, it is the preferred method for high-value transactions where certainty of payment is essential.
You need a sort code together with an account number for any domestic UK payment, including:
For international transfers to and from the UK, the sort code is embedded within the IBAN. A UK IBAN contains the sort code and account number after the country code, check digits, and bank identifier. If you need to understand how sort codes relate to other bank identifiers, see our guide on sort code vs routing number vs IBAN.
The UK adopted the International Bank Account Number (IBAN) standard to facilitate cross-border payments within Europe and beyond. A UK IBAN is 22 characters long and follows this structure:
This means that if you know your UK IBAN, you can extract your sort code from characters 9 through 14 (positions after the 4-character bank code). Conversely, if you know your sort code and account number, your bank can construct your IBAN. This relationship is particularly important when receiving international payments, as senders outside the UK will need your IBAN rather than just your sort code and account number. To learn how to locate your sort code, see our guide on how to find your sort code.
The rise of digital-only banks in the UK — such as Monzo, Starling Bank, and Revolut — has raised questions about whether sort codes are still necessary. The answer is a clear yes. Despite operating without physical branches, these challenger banks still participate in the same UK payment systems (Faster Payments, Bacs, and CHAPS) and therefore require sort codes.
Digital banks typically have a smaller number of sort codes compared to traditional high-street banks with hundreds of branches. Monzo, for example, uses sort codes in the 04-00-04 range, while Starling Bank uses 60-83-71 (issued through its partnership with NatWest's clearing system). Revolut UK accounts use sort codes provided through their banking licence arrangements. In all cases, the sort code functions identically to those used by traditional banks — it routes payments through the UK clearing systems to the correct institution.
These three formats serve similar purposes in different regions:
| Format | Region | Length |
|---|---|---|
| Sort Code | UK & Ireland | 6 digits |
| Routing Number | United States | 9 digits |
| IBAN | 80+ countries | 15–34 characters |
For a detailed comparison of how these systems differ and when to use each one, read our complete guide on sort code vs routing number vs IBAN.
The Republic of Ireland historically used the same sort code system as the United Kingdom, a legacy of the pre-independence shared banking infrastructure. Irish sort codes followed the same 6-digit format and were used in the same way for domestic payments. However, since Ireland's adoption of the euro and the Single Euro Payments Area (SEPA), the country has transitioned to using IBANs and BIC codes for all payments. Irish banks no longer issue new sort codes, and domestic payments in Ireland now use IBAN as the primary account identifier.
That said, some legacy Irish sort codes still appear in older banking records and documents. If you encounter an Irish sort code, it will follow the same format as a UK sort code but will not be part of the UK clearing system. Northern Ireland, as part of the United Kingdom, continues to use sort codes through the standard UK payment systems.
Errors with sort codes can cause payments to fail or, worse, to be sent to the wrong account. Here are the most common mistakes people make:
XX-XX-XX or XXXXXX. Entering them with spaces, slashes, or other separators may cause payment forms to reject the input.Use our sort code validator to check whether a sort code is valid and see which bank and branch it belongs to. The tool verifies the format and looks up the bank details instantly. If you need to find your own sort code first, check our step-by-step guide on how to find your sort code.
Back to all guides.