Test card only

Credit Card Number Generator

Generate dummy card details for development and QA. Nothing is stored or sent to a server.

Card network
These numbers are dummy, Luhn-valid test values for software testing only. They are not real active cards and cannot be used for payments.

This American Express card generator produces 15-digit, Luhn-valid Amex test numbers with 4-digit CID codes. An Amex card generator is worth having separately from the others for one reason: American Express differs from Visa and Mastercard in almost every dimension except the checksum, and those differences are the most frequently missed details in payment forms.

American Express card number format

PropertyValueDiffers from Visa/Mastercard?
First digits (IIN)34, 37Yes
Length15 digitsYes — others use 16
Digit grouping4-6-5Yes — others use 4-4-4-4
Check digitLuhn (mod 10)No
Security code nameCID (Card Identification Number)Yes
Security code length4 digitsYes — others use 3
Security code locationFront of the cardYes — others put it on the back

Six of the seven rows differ. Only the checksum is shared.

Why Amex breaks payment forms

Five failures, in rough order of how often they appear. Each one is reproducible with the generator above.

1. Hard-coded 16-digit length

// Rejects every American Express card ever issued
if (cardNumber.length !== 16) return 'Invalid card number';

Length is a property of the brand, not of cards in general. Derive it from the detected network — 15 for Amex, 16 for Mastercard, 13/16/19 for Visa.

How to test it: generate an Amex number here, paste it into your form, and confirm it is accepted.

2. Fixed 3-digit security code field

A maxlength="3" on the security-code input truncates the last digit of a CID. The card is valid, the cardholder typed the right code, the payment fails, and nothing on screen explains why. This is the worst of the five because it is invisible.

const cvvLength = brand === 'amex' ? 4 : 3;

How to test it: generate an Amex card, copy the 4-digit CID, and check that all four digits survive being typed into the field.

3. Wrong input mask

A 4-4-4-4 mask renders a 15-digit number as 1234 5678 9012 345, which is not how the number is printed on the card. Amex groups 4-6-5: 1234 567890 12345. Users comparing the screen to the card in their hand will assume they mistyped.

How to test it: generate a number and compare your field’s grouping against the 4-6-5 formatter below.

4. “The 3 digits on the back” help text

The copy and the little card illustration next to the security-code field are wrong for Amex. The CID is four digits, on the front, to the right of the card number. Static help text sends every Amex customer looking at the wrong side of their card.

How to test it: switch your form to Amex and confirm the help text and illustration change with it. The CVV generator produces codes at the right length for each network, and explains why the code cannot be derived from a card number by anyone but the issuer.

5. Brand detection that waits too long

34 and 37 are decisive after two keystrokes. A form that waits for four digits — or for the field to blur — before showing the Amex mark and resizing the CID field feels broken even when it eventually behaves correctly.

How to test it: type 37 and confirm the mark appears and the security-code field grows to four digits immediately.

Amex regex and validation

const AMEX = /^3[47]\d{13}$/;

// Grouping helper: 4-6-5
function formatAmex(n) {
  const d = n.replace(/\D/g, '').slice(0, 15);
  return [d.slice(0, 4), d.slice(4, 10), d.slice(10, 15)]
    .filter(Boolean).join(' ');
}

formatAmex('374245455400126'); // "3742 454554 00126"
formatAmex('378282246310005'); // "3782 822463 10005"

AMEX.test('374245455400126');  // true  — 15 digits, 37 prefix
AMEX.test('3742454554001260'); // false — 16 digits
AMEX.test('35282246310005');   // false — 35 is not Amex

The pattern is short because Amex is the simplest network to match: two prefixes, one length, no ranges. Strip separators before testing — it matches digits only, and it checks shape rather than the checksum, so run a Luhn check as well.

American Express product lines

  • Green, Gold, Platinum, Centurion — tiers of the same consumer product; all begin 34 or 37 and share the identical format
  • Corporate and business cards — same format again
  • Co-branded cards issued with airline and hotel partners — still 15 digits

There is no product tier encoded in the number. In some markets Amex-branded cards are issued by a local bank under licence rather than by American Express itself, and even then the number format does not change. If you need to know the product or the issuer, that is a BIN table lookup — see the BIN and IIN guide.

Amex acceptance and BIN routing

One structural difference matters for integration work. Visa and Mastercard operate four-party models: they run the network, while banks issue the cards and acquire the merchants. American Express traditionally ran a three-party model in which it is the network, the issuer, and the acquirer at once — though it also licenses issuance to banks in many markets.

The practical consequence is that Amex acceptance is often a separate commercial arrangement. Some processors require a distinct Amex merchant account, settlement can run on a different timetable, and your routing logic may need to send 34/37 traffic somewhere other than the rest. Worth confirming before your first Amex transaction rather than after.

Official Amex test numbers

This generatorGateway sandbox card
Passes client-side Luhn checkYesYes
Triggers Amex brand detectionYesYes
Produces a 4-digit CIDYesYes
Unlimited unique numbersYesNo — a handful of fixed numbers
Returns an authorisation responseNoYes
Triggers specific decline codesNoYes
Works with 3-D Secure flowsNoYes

Use this generator while you are fixing the five form problems above; switch to the gateway’s own numbers once the processor’s responses are what you are testing. Stripe and PayPal publish full tables, and we collect the equivalents on the test card numbers reference. Card numbering in general is defined by ISO/IEC 7812.

The other networks have their own pages — Visa, Mastercard, and Troy — while the all-network generator mixes Amex with 16-digit brands in one run, which is the fastest way to prove your form handles both shapes. The tool directory lists everything else, and the FAQ covers what a Luhn-valid number does and does not prove.

Frequently Asked Questions

15, not 16. American Express is the most common card in circulation that does not use a 16-digit number, which is why a hard-coded length check of 16 rejects every Amex card.
It is simply a different scheme design. American Express calls its code the CID and made it four digits; Visa’s CVV2, Mastercard’s CVC2, and most others are three. Nothing about the card number determines the code length, so your form has to derive it from the detected brand.
On the front, printed to the right of the embossed card number — not on the signature panel on the back, where Visa and Mastercard put theirs. Checkout help text and card illustrations that say “the three digits on the back” are wrong for every Amex customer who reads them.
Yes. Both sit under the Major Industry Identifier 3, which covers travel and entertainment, so they share that leading digit with JCB and Diners Club. Two digits are enough to identify American Express specifically.
Almost always one of two things: a length check that requires 16 digits, or a security-code field with maxlength=“3” that silently truncates the 4-digit CID. Both fail on well-formed cards, and neither produces an error message the cardholder can act on.
No. It is the most widely published American Express test number in the industry and appears in the documentation of nearly every payment gateway. It is Luhn-valid and deliberately not assigned to any account.
Yes. The check digit rule is identical across Visa, Mastercard, American Express, and almost every other scheme — the mod-10 Luhn checksum. Length, grouping, and security code differ; the checksum does not.