Sort Code

GET/v0/gb/sort-code

Validates a UK sort code — the 6-digit number used to identify bank branches in the United Kingdom and Ireland. The code is formatted as three pairs of digits separated by hyphens (XX-XX-XX). This endpoint validates the format only. Spaces and hyphens in the input are stripped automatically.

Try it

Query Parameters

ParameterTypeRequiredDescription
valuestringYesThe 6-digit sort code (e.g. 20-00-00)

Example Request

curl -H "Authorization: Bearer YOUR_API_KEY" \
  "https://api.isvalid.dev/v0/gb/sort-code?value=20-00-00"

Response Fields

FieldTypeDescription
validbooleanWhether the sort code has a valid 6-digit format
sortCodestringThe normalized 6-digit sort code
formattedstringSort code in standard UK format (XX-XX-XX)

Example Response

{
  "valid": true,
  "sortCode": "200000",
  "formatted": "20-00-00"
}

Example Response — invalid

{
  "valid": false
}