Skip to main content
Back to Numbers generators

Numbers

Random UK Sort Code Generator

Used by developers, writers, and creators worldwide.

A random UK sort code generator is exactly what fintech developers and QA engineers need when building payment forms, seeding test databases, or mocking open banking APIs without touching real customer data. Sort codes are six-digit identifiers, written as three hyphen-separated pairs like 20-00-00, that route domestic UK payments through BACS, Faster Payments, and CHAPS. This tool generates fictitious sort codes instantly. You control the count, the format — hyphenated, spaced, or plain — and whether each code is paired with a fake eight-digit account number. That last option is handy because most UK payment validation libraries check both fields together.

Loading usage…

Free forever — no account required

How to use

  1. Choose your options above
  2. Click Generate
  3. Copy your result

Detailed instructions

  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 Postgres staging database with hundreds of synthetic UK bank records for load testing
  • Triggering sort code and account number validation logic in a React payment form using a Jest fixture
  • Populating Postman mock responses for an open banking API that expects full UK bank detail objects
  • Generating paired sort code and account number rows for a Cypress end-to-end test of a BACS submission flow
  • Creating realistic-looking bank detail fields for fintech product screenshots and Figma prototype 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 randomly generated UK sort codes real bank branches

No. These codes are fictitious and not verified against the UK Payments Administration sort code directory. A small number may coincidentally match a real branch, but they should only ever be used in development, testing, or demo environments — never submitted to a live payment network.

what format should I pick for CSV or database import

Use the plain six-digit format (200000) when importing into a database char(6) or numeric column. Choose the hyphenated format (20-00-00) for human-readable CSVs or when populating UI fields where users expect the standard display style. The spaced format (20 00 00) matches some legacy system exports.

can fake sort codes pass validation checks in payment libraries

UK sort codes have no Luhn or checksum algorithm, so any correctly formatted six-digit number passes basic format validation. However, if your app queries a live directory like the EISCD, randomly generated codes will fail that lookup. These codes are safe for format and field-level testing, not for directory-lookup testing.