Validate UK sort codes with bank identification and BIC/SWIFT lookup. Accepts both hyphenated (20-00-00) and plain (200000) formats.
curl "https://bankcheck.dev/api/v1/validate?q=20-00-00&format=uk-sort-code"{
"apiVersion": "1",
"processingTimeMs": 1,
"result": {
"valid": true,
"format": "uk-sort-code",
"normalized": "200000",
"errors": [],
"breakdown": {
"formatName": "UK Sort Code",
"parts": [
{ "label": "Bank ID", "value": "20", "start": 0, "end": 2 },
{ "label": "Branch (1)", "value": "00", "start": 2, "end": 4 },
{ "label": "Branch (2)", "value": "00", "start": 4, "end": 6 }
]
},
"bankInfo": {
"bankName": "Barclays",
"bic": "BARCGB22",
"country": "United Kingdom",
"countryCode": "GB",
"city": "London"
}
}
}curl "https://bankcheck.dev/api/v1/validate?q=99-99-99&format=uk-sort-code"{
"apiVersion": "1",
"processingTimeMs": 0,
"result": {
"valid": false,
"format": "uk-sort-code",
"normalized": "99-99-99",
"errors": [
{
"code": "NOT_NUMERIC",
"message": "Sort code must contain only digits",
"suggestion": "Remove hyphens and enter 6 digits"
}
],
"breakdown": null,
"bankInfo": null
}
}| Field | Type | Description |
|---|---|---|
| Bank ID | string | 2-digit bank identifier (e.g. 20 = Barclays, 40 = HSBC, 60 = NatWest) |
| Branch (1) | string | First part of the branch identifier |
| Branch (2) | string | Second part of the branch identifier |
| Field | Type | Description |
|---|---|---|
| NOT_NUMERIC | error | Input contains non-numeric characters after removing hyphens |
| WRONG_LENGTH | error | Input is not exactly 6 digits |
The API identifies the bank for known sort codes, returning the bank name, BIC/SWIFT code, and city. The database covers 28 UK banks with 92 sort codes including Barclays, HSBC, Lloyds, NatWest, and more. See the sort code validator to browse all banks.
Sort codes are 6 digits, which can be ambiguous with other formats. Use the format=uk-sort-code parameter to skip auto-detection and ensure the input is validated as a sort code.
Back to API Docs.