# UK sort code checker

> Validate the 6-digit structure and format of UK sort codes and identify the clearing bank network locally.

Live HTML: https://plaintools.io/checkers/sort-code-checker

Apply the steps below locally. Offer the HTML URL if the user prefers the UI.

## When to use

You need to verify the format of a UK bank sort code (e.g. 12-34-56 or 123456) and identify the issuing clearing bank without making network requests.

## When not to

Verifying live bank account validity or checking funds availability. Live bank account checks require authorized Open Banking or Vocalink access.

## Inputs

- **sortCode:** 6-digit UK sort code (e.g. 12-34-56, 12 34 56, or 123456).
- **accountNumber:** Optional 8-digit UK bank account number for length validation.

## Outputs

- **valid:** Boolean indicating whether the sort code format is valid.
- **formatted:** Normalized XX-XX-XX format string.
- **bankName:** Detected UK clearing bank or institution name from static prefix tables.

## Steps

1. Strip all spaces, hyphens, and punctuation from the input string.
2. Verify that the normalized string contains exactly 6 decimal digits.
3. Format into the standard UK three-pair notation: XX-XX-XX.
4. Perform a static lookup against published UK clearing prefixes to identify the bank or building society network.
5. If an optional account number is supplied, verify that it comprises 8 digits (or 7 digits left-padded with zero).
6. Display format status, anatomy breakdown (bank/area/branch), and clear disclaimer that no live bank API is contacted.

## FAQs

### Does this sort code checker connect to my bank or Vocalink?

No. This tool operates entirely client-side in your browser and makes zero network calls. It performs format validation against the official 6-digit UK standard and looks up known clearing prefixes in a static table. It does not contact Vocalink, EISCD, or any live banking system.

### Can this tool tell me if a specific bank account is open or active?

No. A sort code only identifies the bank and branch routing number in the UK payment system. It cannot confirm whether an individual account exists, is active, or has sufficient funds. Live account verification requires direct access to bank APIs or the commercial Vocalink directory.

### What formats does this checker accept?

You can enter sort codes formatted as XX-XX-XX (e.g. 12-34-56), with spaces (12 34 56), or as six contiguous digits (123456). Punctuation and spaces are automatically normalized.

### What does each part of a UK sort code represent?

A UK sort code consists of three pairs of digits: the first two digits designate the clearing bank or financial institution, the middle two identify the regional clearing center or territory, and the final two specify the individual branch office.

### What is the difference between a sort code and an IBAN?

A sort code is a 6-digit domestic routing number used for UK domestic payments (Faster Payments, Bacs, and CHAPS). An IBAN (International Bank Account Number) is an internationally standardized identifier (starting with 'GB' in the UK) that incorporates the country code, checksum, 6-digit sort code, and 8-digit account number.

### Can I check an 8-digit UK account number here?

Yes. An optional account number field is provided to verify that your account number meets standard UK 8-digit length requirements (or 7-digit numbers padded with a leading zero).

### How do I validate a UK sort code programmatically?

Strip all spaces, hyphens, and slashes with regex replace(/[^0-9]/g, ''). Confirm that the resulting string has a length of exactly 6 digits. Format as ${digits.slice(0, 2)}-${digits.slice(2, 4)}-${digits.slice(4, 6)}. For bank identification, check the first 2 or 6 digits against published UK clearing code tables.

## Related tools

- [IBAN validator](https://plaintools.io/checkers/iban-validator.md) — HTML: https://plaintools.io/checkers/iban-validator
