Format, modulus check and bank lookup in one screen
Sort Code Checker
A UK sort code is the six-digit number that tells a bank which branch or division an account is held at, always written as three pairs like 20-00-00. Type a sort code below and this tool checks its format, runs a general-purpose modulus check against an account number if you enter one, and tells you which bank group the sort code belongs to. Nothing you type is sent anywhere; the whole check runs in your browser, so it works just as well for a quick sanity check before you send a payment as it does for double-checking a form you are filling in.
This runs a general-purpose Modulus 11 / Double Alternate check using Vocalink's standard weighting table, and identifies the bank group from a public sort-code range list (Wikipedia). Some sort codes use bank-specific weighting exceptions from Vocalink's full, licensed dataset that this free tool does not have access to. A "does not pass" result on an unusual sort code is not a guarantee the account is wrong. Always confirm important payments with your bank if in doubt. See the full UK bank sort code range list for how bank groups are identified.
What a sort code actually is
Sort codes were introduced by British clearing banks in the 1950s so that cheques and, later, electronic payments could be routed to the correct branch automatically instead of by hand. Every sort code is six digits long and is almost always written as three pairs separated by hyphens, for example 20-00-00. The first two digits broadly identify which bank (or bank group) issued the code – Barclays sort codes mostly start with 20, NatWest with 01 or 50-59, HSBC UK with 40-49, and so on. The remaining digits narrow it down to a specific branch or, for newer digital-only banks, a specific internal division rather than a physical branch. Building societies and some newer banks use the same six-digit system even though they are not clearing banks in the historical sense.
A sort code on its own does not identify an account – it needs to be paired with an account number, which is normally eight digits. Together, the sort code and account number are what UK bank transfers (Faster Payments, BACS, CHAPS and cheques) route on, in the same way an IBAN routes a payment in most of continental Europe.
How the format check works
The format check is the simplest part: it strips out any hyphens or spaces you typed and checks that exactly six digits are left. If you type 20-00-00, 200000, or 20 00 00, they are all treated the same way and shown back to you in the standard hyphenated form. Anything shorter, longer, or containing letters is flagged as an invalid format straight away – that alone catches the single most common mistake people make when copying a sort code by hand: transposing two digits or missing one entirely.
How the modulus check works
A valid-looking sort code and account number combination can still be wrong – for example if a digit got swapped when someone typed it into a form. Modulus checking is a maths-based way of catching a large share of those typos without contacting the bank. UK banks and building societies publish the check as part of a specification maintained by Vocalink (the company behind the Bacs and Faster Payments infrastructure), and this tool implements the two general-purpose algorithms from that specification exactly as documented:
- Standard Modulus 11: each of the fourteen digits (six from the sort code, eight from the account number) is multiplied by a fixed weight, the results are added together, and the total must divide evenly by 11.
- Double Alternate (Modulus 10): the same fourteen digits are multiplied by alternating weights of 2 and 1; if a product is a two-digit number its digits are added together first (for example 18 becomes 1+8=9); the running total must divide evenly by 10.
Want the exact digit-by-digit maths behind both checks, worked through step by step? See how modulus checking works. This tool runs both checks and reports a pass if either one succeeds, because different UK sort codes are set up to use one method or the other. Enter a sort code and an 6, 7 or 8-digit account number to see it in action; leave the account number blank and you will still get the format check and bank lookup on their own.
Why a "does not pass" result is not always wrong
Vocalink's full specification defines weighting tables for the vast majority of sort codes, but a meaningful number of ranges use a bank-specific exception – a different weight table, or an extra rule layered on top of the basic calculation – rather than the two standard tables this tool uses. That full exception dataset is licensed data that banks and payment providers pay to access; it is not something a free browser-based tool can replicate honestly. In practice this means: if the check passes, you can be confident the combination is arithmetically sound. If it does not pass, it is worth double-checking the digits you typed, but it is not a guaranteed proof the account is wrong – some genuine, correctly-typed accounts on exception sort codes will show as "does not pass" here. When a payment actually matters, Confirmation of Payee (the name-matching check UK banks run before a Faster Payment) or a direct check with the receiving bank is the reliable way to be certain, not a modulus check on its own.
How the bank lookup works
The bank/building society field uses a publicly documented list of sort code number ranges (see the full UK bank sort codes list for the complete reference table and its source). It identifies the banking group a sort code prefix belongs to – for example that codes starting 20 to 29 are Barclays, or that 40 to 49 is HSBC UK – which is useful for a quick sanity check ("does this sort code look like it belongs to the bank I think it does?"). It is not the same as the official Extended Industry Sorting Code Directory (EISCD) that banks use internally, which maps every individual sort code to an exact branch name, address and payment-scheme capability and is only available through a paid data licence. If a sort code's prefix is not in our reference table, the tool says so plainly rather than guessing.
Three worked examples
A few examples using the exact same calculation this tool runs, so you can see what a pass and a fail look like:
- Sort code 18-00-02, account number 98093517: format valid, bank lookup shows Coutts, and the Standard Modulus 11 check passes (this is one of the two official worked examples published in Vocalink's own specification, reproduced here so the maths is independently checkable).
- Sort code 49-92-73, account number 12345678: format valid, bank lookup shows HSBC UK (the 40-49 range), and the Double Alternate check passes (the second official worked example from the same specification).
- Sort code 18-00-02, account number 11111111: format valid, bank lookup shows Coutts, but neither modulus check passes – a clear sign the account number was mistyped or does not belong to that sort code.
Common sort code questions this tool answers
People usually land on a sort code checker for one of a few reasons: confirming a sort code copied from a cheque or an old bank statement is still correctly formatted, sanity-checking a sort code and account number typed into an online form before submitting it, or simply working out which bank a sort code belongs to when it is not obvious from the number alone (this comes up a lot with newer digital banks, which are often issued sort codes in ranges historically used by a larger bank). This tool is built to answer all three directly, on one screen, without creating an account or sending your details anywhere.
What this tool does not do
To be clear about scope: this tool does not check whether a sort code is currently live and accepting payments (only Vocalink's live, weekly-updated data can do that), it does not check whether the account name matches the account holder (that is Confirmation of Payee, run by the receiving bank, not a modulus check), and it does not know which payment schemes – Faster Payments, CHAPS, Direct Debit – a specific sort code supports. If you need any of those specifically, your bank's own payment confirmation step or Pay.UK's official sort code checker are the right tools; this one is for a fast, private, no-sign-up format and modulus sanity check plus a bank lookup.
Frequently asked questions
Is this sort code checker free?
Does this tool store or send my sort code and account number anywhere?
Why did my sort code and account number fail the modulus check even though I'm sure they're correct?
What's the difference between a sort code and an account number?
Can I check an account number without a sort code?
Does this tell me if a sort code is currently active?
Which banks does the bank lookup cover?
Why do two different banks sometimes show the same sort code range?
Want to know which bank a sort code belongs to?
See the full UK bank sort code range reference table.
View the bank sort codes listFree. No sign-up.