Payment card
Card numbers are long and copied from a small card, and every small obstacle here loses payments.
The answer
Take the card number in one field, with or without spaces, and work out the card type yourself. As strong as the weakest rule behind it: moderate.
-
Take the card number in one field, with or without spaces.
Baymard reports errors where spaces are refused, without participant numbers; GOV.UK, Stripe and Google agree. Rated 3.
- Applies when
- Always.
- Based on
- Practitioner research
- Principle
- Prevent errors
- Common mistake
- Rejecting a card number typed with spaces (rule 2).
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- User researchUser research: The credit card number field must allow and auto-format spacesLars Soderlund, 2025
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
- Guidance: Payment forms (Learn Forms)web.dev
-
Work out the card type from the number. Don’t ask for it.
Three sources agree. Rated 3.
- Applies when
- Always.
- Based on
- Convention
- Principle
- Leave out what is not needed
- Common mistake
- A drop-down asking for the card type (rule 5).
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- User researchUser research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
The other rules
-
Mark card fields with the standard card autocomplete tokens.
WCAG 2.2 level AA (1.3.5).
- Applies when
- The person is entering their own details.
- Based on
- Standard or law
- Depends on
- Whose details they enter
- Principle
- Work for everyone
- GuidanceGuidance: wcag22-1.3.5
- Guidance: Payment forms (Learn Forms)web.dev
-
Show a number pad for the card number and security code.
Four sources agree. Rated 3.
- Applies when
- On small touch screens.
- Based on
- Convention
- Depends on
- Device and screen
- Principle
- Let practiced people go faster
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- User researchUser research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
- Guidance: Payment forms (Learn Forms)web.dev
-
Take the expiry date as month and year, as printed on the card.
Baymard's testing and GOV.UK; matches Entering a date, rule 11. Rated 3.
- Applies when
- Always.
- Based on
- Practitioner research
- Principle
- Make controls match their effects
- User researchUser research: Format the Expiration Date fields exactly the same as the physical credit cardIva Olah, 2023
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
-
Check the card number’s checksum and say at once if it fails.
Baymard and Stripe. Rated 3.
- Applies when
- Always.
- Based on
- Convention
- Principle
- Prevent errors
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- User researchUser research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
-
Ask for details in the order they appear on the card.
GOV.UK and Baymard; Stripe prescribes no order. Rated 2.
- Applies when
- Always.
- Based on
- Convention
- Principle
- Make controls match their effects
- User researchUser research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
-
Keep the card details when an error elsewhere sends people back.
One practitioner source. Rated 2.
- Applies when
- A submit was rejected.
- Based on
- Practitioner research
- Principle
- Keep people in control
- User researchUser research: Preserve credit card details when a validation error occursSonia Sousa, 2024
-
Ask for the name on the card only if your payment processor requires it.
Baymard says it can be dropped; GOV.UK says do not assume it matches a name given elsewhere. Rated 1.
- Applies when
- Always.
- Based on
- Practitioner research
- Principle
- Leave out what is not needed
- User researchUser research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
- GuidanceGuidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
-
Don’t jump focus to the next field on its own.
One vendor recommends it without evidence; WCAG allows it only when people are told first, and government systems forbid it for dates. Rated 1.
- Applies when
- Always.
- Based on
- Convention
- Principle
- Keep people in control
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- StandardStandard: Understanding SC 3.2.2 On Input (Level A)W3C WAI
Accessibility
Open questions
Sources
- ExperimentExperiment: Credit card checkout UI design - what to include, what to skipStripe, 2025
- User researchUser research: The credit card number field must allow and auto-format spacesLars Soderlund, 2025
- User research: Credit card form UX (L.L.Bean as best-in-class example)Baymard Institute, 2020
- User research: Format the Expiration Date fields exactly the same as the physical credit cardIva Olah, 2023
- User research: Preserve credit card details when a validation error occursSonia Sousa, 2024
- StandardStandard: Understanding SC 3.2.2 On Input (Level A)W3C WAI
- GuidanceGuidance: wcag22-1.3.5
- Guidance: Payment forms (Learn Forms)web.dev
- Guidance: Ask users for payment card details (GOV.UK Design System pattern)GOV.UK Design System / GOV.UK Pay team
Related
- Input masks and formatting as you typeAccept the separators people type and clean them up yourself, and show the expected shape outside the field.Answer: moderate.
- Autofill and identifying input purposeMark each field with what it is for, and never block autofill, pasting or password managers.Answer: settled.
- Entering a dateLet people type a date they know. Show a calendar only when they are choosing one, and still let them type.Answer: moderate.
- Checkout stepsBefore the order is placed, show what is being bought and the total, with a review where each part can be changed.Answer: moderate.