IBAN Toolkit logoIBAN Toolkit

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.

Frequently asked questions

No public one. The definitive sort-code list is maintained by UK banks; apps validate format (6 digits) rather than a checksum.
Roughly: the first digits hint at the bank: but ranges are reused and reassigned, so never rely on it. Use the bank's official lookup for real codes.
They're random and may coincidentally overlap real ranges. They're test placeholders only: never use them on real transfer forms.
Testing and educational use. Generated identifiers are synthetic and are not checked against live bank directories. A randomly generated value can coincidentally resemble or match a real identifier. Never use generated data for real payments, account applications, identity verification, or to represent a real person or institution.