Skip to content

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.

Was this tool helpful?
Give feedback

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:

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:

  1. 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).
  2. 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).
  3. 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?
Yes, completely free with no sign-up, no daily limit, and no data sent to a server – every check runs in your browser.
Does this tool store or send my sort code and account number anywhere?
No. The format check, modulus check and bank lookup all run entirely in your browser using JavaScript. Nothing is sent to a server, logged, or stored anywhere except your own browser's local storage, which only remembers what you last typed so the fields are pre-filled if you come back. See the privacy page for details.
Why did my sort code and account number fail the modulus check even though I'm sure they're correct?
A minority of UK sort codes use a bank-specific weighting exception that this free tool does not have access to (see "Why a 'does not pass' result is not always wrong" above). If you have triple-checked the digits and it still fails, that is more likely the explanation than a genuine error – for anything payment-critical, check directly with the bank.
What's the difference between a sort code and an account number?
The sort code (6 digits, e.g. 20-00-00) identifies the bank and branch or division. The account number (usually 8 digits) identifies the specific account at that branch. You need both together to send a UK bank transfer.
Can I check an account number without a sort code?
No – the modulus check is defined against a specific sort code's weighting table, so a sort code is always required. Enter it along with the account number to run the check.
Does this tell me if a sort code is currently active?
No. This tool checks format and runs a general mathematical validity check plus a bank-group lookup; it does not query a live, up-to-date bank database. For a currently-active sort code check, Pay.UK (the body that manages the UK's sort code system) publishes its own official checker.
Which banks does the bank lookup cover?
It covers the main sort code number ranges for the major UK clearing banks and building societies – NatWest, Barclays, HSBC UK, Lloyds Bank and TSB, Santander UK, Bank of Scotland, Royal Bank of Scotland, Nationwide, Co-operative Bank, Sainsbury's Bank, Coutts and the 04 range used by many newer digital banks. See the full list for the complete reference table.
Why do two different banks sometimes show the same sort code range?
Several UK banks merged or were acquired over the decades (for example Lloyds Bank and TSB now share the 30-39 and 77 ranges, and Alliance & Leicester's old range is now Santander UK), so a range can legitimately be listed under more than one historical name. The lookup shows the current group.

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 list

Free. No sign-up.