Numbers

Random UK Sort Code Generator

A UK sort code is a six-digit number written as three hyphen-separated pairs — for example, 20-00-00 — that identifies a specific bank and branch within the British banking system. This random UK sort code generator creates correctly formatted, fictitious sort codes instantly, giving developers, testers, and fintech teams realistic-looking data without touching real customer banking details. You control how many codes are produced, which format they appear in, and whether each code comes paired with a fake eight-digit account number. Sort codes appear in BACS transfers, direct debits, standing orders, and Faster Payments, so any software that handles UK bank details needs to accept and validate them correctly. Generating realistic fake sort codes lets you populate test databases, trigger form validation logic, and simulate payment flows in staging environments without violating data protection rules or risking real transactions. Developers building open banking integrations, payroll platforms, or KYC workflows often need hundreds of synthetic UK bank detail records at once. This tool lets you generate up to a large batch in a single click, formatted consistently so the output drops straight into fixtures, seed scripts, or mock API responses. The optional paired account number feature is especially useful when testing full sort code and account number combinations, since many UK payment validation libraries check both fields together. All output is entirely fictitious and carries no connection to real bank branches or account holders.

How to Use

  1. Set the count field to the number of sort codes you need, from one up to your required batch size.
  2. Choose a format — hyphenated (20-00-00), plain (200000), or spaced (20 00 00) — to match your application's expected input.
  3. Toggle the Include Account Number option to 'Yes' if you need complete sort code and account number pairs for two-field testing.
  4. Click Generate to produce the list of fictitious sort codes instantly.
  5. Copy the output and paste it directly into your test fixture, seed script, CSV file, or mock API payload.

Use Cases

  • Seeding a test database with hundreds of fake UK bank records
  • Triggering sort code validation logic in a payment form
  • Populating mock API responses for open banking integrations
  • Testing BACS or Faster Payments submission workflows in staging
  • Generating paired sort code and account number fixtures for unit tests
  • Filling demo accounts in a payroll or HR software prototype
  • Simulating direct debit mandate entries for QA regression testing
  • Creating realistic-looking data for fintech product screenshots or demos

Tips

  • Select the plain format when seeding a SQL database — most schemas store sort codes as char(6) without separators.
  • Use paired account numbers when testing validation libraries like uk-modulus-checking, which expects both fields together.
  • Generate a batch of 50+ codes at once for stress-testing forms that must handle bulk bank detail uploads.
  • If your form auto-formats user input (inserting hyphens as they type), test it with the plain format output to verify the formatter fires correctly.
  • For screenshots and marketing demos, the hyphenated format looks most authentic to UK users — avoid plain strings in public-facing mockups.
  • Cross-check a handful of generated codes against the EISCD lookup in your staging environment to confirm your app handles 'unknown sort code' responses gracefully.

FAQ

Are these randomly generated sort codes real?

No. The codes are algorithmically generated and are not verified against the UK sort code directory. Some may coincidentally match a real branch, but most will not. They should only be used in development, testing, or demo environments — never submitted to a real payment network.

What format do UK sort codes use?

UK sort codes are always six digits split into three two-digit pairs. The hyphenated form (20-00-00) is the standard human-readable format. Some systems store them as a plain six-digit string (200000) or with spaces (20 00 00). This generator supports all three so output matches your system's expected format.

Can I use fake sort codes in a production app?

No. Live payment systems — BACS, Faster Payments, CHAPS — validate sort codes against the UK Payments Administration directory. Fictitious codes will be rejected and could cause failed transactions. Always use verified sort codes for any real-money processing.

What is the paired account number option for?

Many UK payment validation libraries and APIs require both a sort code and an eight-digit account number together. The paired account number option generates a fake eight-digit number alongside each sort code so you can test two-field validation, form layouts, and API payloads that expect complete bank detail records.

How many digits is a UK bank account number?

Standard UK current account numbers are eight digits long. This is separate from the six-digit sort code. Together they form a full set of UK bank details used for domestic transfers. Some older accounts had seven digits, which banks typically zero-pad to eight for modern systems.

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

A sort code is a domestic UK identifier for a bank branch. An IBAN (International Bank Account Number) is a standardised international format that, for UK accounts, encodes the sort code and account number within a longer GB-prefixed string. Sort codes are used for domestic UK payments; IBANs are required for international transfers.

Can these sort codes pass Luhn or MOD check validation?

UK sort codes do not use a Luhn or checksum algorithm, so any valid-looking six-digit number formatted correctly will pass basic format validation. If your application runs a lookup against a live sort code database or the EISCD, randomly generated codes will typically fail that lookup check.

What format option should I choose for CSV or database import?

Use the plain (no separator) format when importing into a database column that stores sort codes as a numeric or char(6) field. Use the hyphenated format for human-readable CSV files or when populating UI fields where users expect the standard XX-XX-XX display style.