Sort Code Generator
Test UK sort codes in XX-XX-XX format: for dev, QA and demos.
Generate test sort codes
Random 6-digit codes in standard format. UK sort codes have no public checksum: format validity is what apps typically check.
How this tool works
This tool is designed for testing, education and workflow prototyping. It validates or generates structurally correct values based on published format rules and clearly states where no live-bank lookup is performed.
What is a UK sort code?
A sort code is the 6-digit number (written XX-XX-XX) that identifies a specific bank branch in the UK and Ireland. It travels with the 8-digit account number in every domestic transfer: and both are embedded in the UK IBAN (GB + check digits + 4-letter bank code + 6-digit sort code + 8-digit account).
How sort codes are structured
- First two digits broadly identify the bank (e.g. 20: for Barclays ranges, 40: for HSBC ranges: though ranges are reused and not a reliable bank lookup).
- All six digits together identify the branch.
- Unlike IBANs, sort codes have no public checksum algorithm: the authoritative list is maintained by the UK banking industry, not computable.
Using them in tests
Because there is no checksum to satisfy, sort-code testing focuses on format: 6 digits, correct grouping, numeric-only input handling. Pair a generated sort code with an 8-digit account number from our account number generator: or generate the complete UK package at once with the IBAN generator set to United Kingdom.