Reference Number Generator – Create Payment and Case References
Use the Reference Number Generator above to create structured reference numbers for payments, correspondence, cases, applications, internal records and other workflows that need a stable human-readable identifier.
Choose a prefix, sequence or random component, number length and separator. When users will type references manually, add a Luhn or MOD 97-style check digit to help detect input errors.
A payment reference might look like PAY-2026-004821-7. A case reference could be CASE-104821. A neutral correspondence ID might be REF-26-K7P4-0082.
The best structure depends on what the number identifies and how it will be used.
A reference number should be unique within its intended scope, stable after issuance and easy to validate without exposing unnecessary information.
What Is a Reference Number?
"Reference number" is a broad term.
It can identify:
- a payment
- a bank transfer
- a case
- an application
- a letter
- a complaint
- a booking
- a claim
- an internal record
- a customer request
- a shipment
Unlike an invoice number or purchase order number, a generic reference does not have one universal meaning.
That makes format design more flexible.
It also means you should document the purpose.
A prefix such as PAY- or CASE- can immediately tell staff what system should be searched.
How to Use This Reference Number Generator
Start by deciding the scope.
Ask: "What exactly does one reference identify?"
Then choose a format.
Set:
- prefix
- sequence length
- starting number
- separator
- optional date component
- random segment
- check-digit method
Generate a sample batch.
Check whether the values are:
- unique
- easy to read
- compatible with downstream systems
- long enough for expected volume
- free of personal data
If the references already exist in another application, do not begin an overlapping sequence.
Use the existing system as the source of truth or migrate carefully.
Sequential Reference Numbers
A simple sequence is easy to operate.
Example:
REF-100001 REF-100002 REF-100003
Sequential references are useful when:
- staff frequently search by number
- chronology matters
- volume disclosure does not matter
- the system can enforce uniqueness
They are predictable.
That is not automatically a security problem.
A predictable reference becomes dangerous when an application treats knowledge of the number as permission.
If /cases/100002 contains sensitive information, the server must verify access regardless of whether the public reference is sequential or random.
Identifiers and authorization solve different problems.
Random Reference Numbers
Random segments reduce predictability.
Example:
REF-K7P4-X82M
This can be useful when:
- references are public
- neighboring sequence values should not be obvious
- users receive one-time correspondence codes
- the visible number should reveal less operational volume
Randomness introduces collision considerations.
The application must have enough possible values for expected volume and should enforce uniqueness.
A short four-digit random number has only 10,000 possibilities.
That may be fine for a temporary local queue and completely inadequate for a large long-lived customer-reference system.
Choose length based on scale.
What Is a Check Digit?
A check digit is an extra character calculated from the rest of an identifier.
Its purpose is to detect errors.
Suppose a user types 4839201 but intended 4839207.
A check algorithm may detect that the resulting reference is invalid.
Check digits are useful for:
- payment references
- account references
- customer service numbers
- printed forms
- manually entered IDs
They are not encryption.
They are not passwords.
They do not stop attackers from constructing a syntactically valid value.
They simply help reject mistyped references before a lookup or transaction proceeds.
Luhn Check Digit
The Luhn algorithm is a widely used checksum method for numeric identifiers.
It processes the digits according to a defined weighting rule and produces a check digit.
Its main value is detecting common data-entry errors.
Luhn is familiar because it appears in several identifier systems.
That does not mean any Luhn-valid number is a valid credit card, account or official identifier.
A checksum only validates arithmetic structure.
For a custom reference system, Luhn can be a convenient lightweight option when the base reference is numeric.
If the business needs a different published standard, use that standard instead.
MOD 97 Check Digits
MOD 97-style check systems use division by 97 as part of the validation process.
ISO/IEC 7064 defines check-character systems designed to protect strings against errors introduced during copying or typing, including MOD 97-10.
MOD 97 is also familiar from financial identifier schemes.
This makes it useful when your workflow benefits from a stronger structured check than a bare sequence.
Do not claim a custom MOD 97 reference is automatically an IBAN or another regulated financial identifier.
The algorithm is only one component.
A standards-compliant banking identifier has many additional format and assignment rules.
Luhn vs MOD 97
Both are error-detection methods.
They are not interchangeable standards.
Use Luhn when:
- your internal system already uses it
- you need a familiar single-digit checksum
- the identifier is numeric and compact
Use MOD 97 when:
- your organization specifies it
- you want a check system aligned with a published MOD 97 method
- the reference format is designed around that validation rule
Do not choose based on which algorithm sounds more secure.
These checks are primarily about transcription errors, not cryptographic security.
If tamper resistance matters, use an authenticated design rather than a simple checksum.
Payment References
Payment references help match incoming money to the correct account, invoice or order.
A useful payment reference should be:
- unambiguous
- easy to quote
- stable
- accepted by the banking/payment field
- mapped to one internal record
Check the character and length restrictions of the payment rail you actually use.
Do not assume every banking system accepts the same punctuation or reference length.
If a payment provider already issues a required reference format, use that format instead of inventing a parallel code.
Generated references are most useful where your business controls the field.
Correspondence References
Government offices, insurers, law firms, support teams and other organizations often put a reference on letters or email.
Example:
CASE-2026-008421
The recipient can quote that number later.
This is useful because names are not unique and subject lines change.
Keep the reference stable through the case lifecycle.
Do not include sensitive case details in the code.
A neutral case number is safer than BENEFITS-FRAUD-SMITH-2026-41.
The reference may appear on envelopes, email subjects and shared documents.
Reference Numbers in URLs
A reference may also appear in a URL.
Example:
/track/REF-K7P4X82M
If the URL reveals account or case details, do not rely on the reference being difficult to guess.
Authorize access or use a deliberately high-entropy access token designed for bearer access.
A normal customer-service reference should be treated as public-ish metadata.
It may be shared in:
- emails
- screenshots
- phone calls
- PDFs
Design application security with that assumption.
Avoid Personal Data in References
Do not encode:
- full name
- birth date
- phone number
- national identifier
- medical information
A reference number should reduce the need to expose personal data, not become another copy of it.
For example, CASE-104821 is preferable to SMITH-19800105-104821 when both can identify the same internal record.
The system can map the neutral reference to protected customer data after authorization.
This supports cleaner data handling and makes the identifier stable if personal details change.
Common Reference Number Mistakes
Avoid these problems:
- treating a check digit as a security feature
- using too little random space for expected volume
- encoding personal data
- allowing duplicate references
- inventing a new format when a bank or platform already specifies one
- making the reference so long users mistype it constantly
- relying on predictability or unpredictability for authorization
- reusing a historical reference for a different record
- using several formats without documenting which system owns each one
- claiming a checksum makes a custom reference an official banking identifier
A good reference number has a clear scope and one stable meaning.