This Diners Club card generator produces Luhn-valid test numbers in the classic 14-digit format. That length is the whole reason the page exists: Diners Club is the shortest primary account number in circulation, and it is the single most reliable way to find out whether your checkout has hard-coded sixteen digits somewhere.
Test card only
Credit Card Number Generator
Generate dummy card details for development and QA. Nothing is stored or sent to a server.
Diners Club card number format
| Property | Value |
|---|---|
| BIN ranges | 300–305, 3095, 36, 38, 39 |
| Classic length | 14 digits |
| Newer products | 16 digits, 19 permitted |
| Check digit | Luhn (mod 10) |
| Security code | 3 digits, on the back |
| Grouping | 4-6-4 |
The 14-digit problem
Most payment forms are built around a mental model of sixteen digits in four groups of four. American Express dents that model at fifteen. Diners Club breaks it outright at fourteen, and the failures it produces are more varied than a simple rejection.
The length check. minlength="15", length === 16, or a regex ending in \d{16} all
refuse a valid card. This is the obvious failure and the easiest to fix.
The input mask. A 4-4-4-4 mask applied to fourteen digits produces 1234 5678 9012 34 —
two orphaned digits in a group that never fills, and often a trailing space the user cannot
delete. The correct grouping is 4-6-4:
function groupDiners(number) {
const d = number.replace(/\D/g, '');
return [d.slice(0, 4), d.slice(4, 10), d.slice(10, 14)]
.filter(Boolean)
.join(' ');
}
groupDiners('30569309025904'); // "3056 930902 5904"
That is the same shape as the Amex formatter most codebases already have, with different offsets. If you have one and not the other, the fix is ten minutes.
The submit-button heuristic. Forms that enable submission once sixteen digits are present never enable it for a Diners cardholder. This one is invisible in testing unless somebody actually types a fourteen-digit number, which is precisely why it survives to production.
The truncation bug. A fixed-width database column or a substr(0, 16) somewhere in the
pipeline does nothing visible to a fourteen-digit number, so this one usually surfaces the
other way — as a nineteen-digit card silently losing its last three digits. Diners is the
network that makes you look.
Newer Diners products are issued at sixteen digits, which tempts people to treat the fourteen-digit format as historical. It is not: those cards remain valid until they expire and are reissued, and until then a checkout that cannot take them is turning away customers with no error you will ever see in a log.
Why 14 digits, and why it stayed
Diners Club predates the standards everything else was built to. It launched in 1950 as the first general-purpose charge card, well before ISO/IEC 7812 defined how account numbers should be structured, and fourteen digits was simply enough for the account base it expected. The sixteen-digit convention arrived later with the bank card networks, and by then Diners had millions of numbers in the field.
That is the useful lesson, and it generalises past this one network: card number formats are not a design, they are an accumulation. Sixteen digits is a convention that most of the industry converged on, not a rule anybody wrote down and enforced. Visa permits thirteen and nineteen, American Express uses fifteen, Maestro spans twelve to nineteen, and Diners keeps fourteen — every one of those is a legacy decision that outlived the reasoning behind it.
Code written against the convention rather than the specification works for years and then fails on a customer who cannot tell you why, because from their side the card is simply refused. Writing the length check against ISO/IEC 7812’s twelve-to-nineteen range costs nothing extra and never needs revisiting.
Where Diners Club is accepted
Diners Club International is part of Discover Global Network, and the two together are accepted in more than 185 countries and territories. In practice that means a Diners card presented in the United States usually clears over Discover rails, and Discover’s other partnerships — including JCB — form the same kind of reciprocal web.
The brand’s centre of gravity is corporate travel and expense, which shapes who you will actually see using one. If you sell to business travellers, airlines, hotels or expense-managed B2B customers, Diners appears more often than its overall market share suggests. If you sell consumer goods online, it is rare — but the length handling still needs to be right, because the same code path serves American Express at fifteen digits.
Brand detection regex
const DINERS = /^3(0[0-5]\d{11,14}|095\d{10,13}|[689]\d{12,16})$/;
The alternation covers the three separate shapes: the 300–305 block, the 3095 block, and
the 36/38/39 blocks. The digit counts differ per branch because the prefix lengths do —
getting those wrong is how a detector ends up accepting thirteen-digit numbers that are not
valid anywhere.
Worth checking against neighbours in the same MII:
DINERS.test('30000000000004'); // true — 14-digit classic
DINERS.test('36000000000000'); // true — the common modern block
DINERS.test('3600000000000000'); // true — 16-digit product
DINERS.test('378282246310005'); // false — American Express, not Diners
DINERS.test('3566002020360505'); // false — JCB, not Diners
The last two assertions are the ones to keep. 3 covers travel and entertainment, so Amex,
JCB and Diners are neighbours, and a sloppy Diners expression will claim cards belonging to
both.
Testing scenarios
- Fourteen digits end to end. Type one into the real form, not just the unit test: mask, length validation, submit button state, and what the confirmation screen displays.
- Grouping. Confirm the mask switches to 4-6-4 when the brand is detected, and that deleting digits does not leave stray separators.
- Mixed-length fixtures. A test set containing fourteen, fifteen, sixteen and nineteen digit numbers will find every hard-coded length in one run.
- Storage width. Confirm the full number survives your database column and any API in between — test with nineteen digits, which is where truncation shows.
- Brand neighbours. Assert that Amex and JCB numbers are not detected as Diners.
Official test numbers
For sandbox testing, use the gateway’s published numbers. Stripe documents
3056 9300 0902 0004 and the 14-digit 3622 7206 271667, Braintree uses
3625 9600 0000 04, and Adyen documents 3600 6666 3333 44. The
test card numbers reference collects them by gateway.
Diners Club International’s own material is published at dinersclub.com, and the network relationship is documented on Discover Global Network.
Related tools and guides
A fourteen-digit number run through the validator shows the length rule being applied correctly, which is a quick way to compare against whatever your own form does with the same input. The length reference tabulates every network’s permitted digit counts in one table — the fastest way to audit a length check against reality. The rest of the generators are in the tool directory, and the FAQ covers what the checksum proves.