autocomplete attribute cheat sheet

The right autocomplete token lets a phone fill a field in one tap. It is also a WCAG 2.1 level AA requirement.

Why it matters

WCAG success criterion 1.3.5, Identify Input Purpose (level AA), asks that fields collecting information about the user identify their purpose in code. In HTML that means the standard autocomplete tokens. Browsers and password managers use the same tokens to autofill. On a phone, that is the difference between typing a full address and tapping it once.

The tokens you will use most

FieldToken
Full namename
First / last namegiven-name / family-name
Emailemail
Phonetel
Street address (one line)street-address, or address-line1 and address-line2
City / stateaddress-level2 / address-level1
ZIP or postcodepostal-code
Countrycountry-name (or country for a code)
Usernameusername
Password on a sign-in formcurrent-password
Password on a sign-up or change formnew-password
Code sent by text messageone-time-code
Card number / expiry / security code / name on cardcc-number / cc-exp / cc-csc / cc-name
Birthdaybday
Companyorganization

Common mistakes

Check it

The checker guesses each field's purpose from its name, id and label. It flags missing or unknown tokens and puts the right one in the suggested tag.

Frequently asked questions

Does autocomplete apply to search boxes?

No. 1.3.5 covers information about the user. A search box or a comment field does not need a token.

Is autocomplete="on" enough?

No. "on" lets the browser guess. A specific token such as email or postal-code is what identifies the purpose.

Found a mistake or want a check added? Write to contact (at) mobileformcheck.com.