autocomplete

Browser autofill hints for one-tap form completion. The single most impactful attribute for form conversion on mobile devices.

Overview

The autocomplete attribute tells the browser what kind of data a field expects, enabling one-tap autofill. On mobile, this means users can complete an entire checkout form by tapping a single autofill suggestion instead of typing on a small keyboard.

Getting autocomplete values right is the single highest-impact change you can make for form conversion on mobile devices.

Applies to: <input>, <select>, <textarea>

Personal Information

ValuePurpose
nameFull name
given-nameFirst name
family-nameLast name
honorific-prefixTitle (Mr., Dr., etc.)
nicknameDisplay name or handle
emailEmail address
telFull phone number with country code
tel-nationalPhone number without country code
bdayDate of birth
organizationCompany or organization name
organization-titleJob title
<form class="stacked"> <label for="name">Full name</label> <input type="text" id="name" autocomplete="name" /> <label for="email">Email</label> <input type="email" id="email" autocomplete="email" /> <label for="tel">Phone</label> <input type="tel" id="tel" autocomplete="tel" /> <button type="submit">Continue</button> </form>

Address

Prefix address values with shipping or billing to distinguish multiple address forms on the same page.

ValuePurpose
street-addressFull street address (may be multiline)
address-line1First line of street address
address-line2Apartment, suite, unit
address-level2City
address-level1State, province, or region
postal-codeZIP or postal code
countryCountry code
country-nameCountry name (localized)
<fieldset> <legend>Shipping address</legend> <label for="street">Street address</label> <input type="text" id="street" autocomplete="shipping street-address" /> <label for="city">City</label> <input type="text" id="city" autocomplete="shipping address-level2" /> <label for="state">State</label> <input type="text" id="state" autocomplete="shipping address-level1" /> <label for="zip">ZIP code</label> <input type="text" id="zip" autocomplete="shipping postal-code" inputmode="numeric" /> <label for="country">Country</label> <select id="country" autocomplete="shipping country"> <option value="US">United States</option> <option value="CA">Canada</option> <option value="GB">United Kingdom</option> </select> </fieldset>

Payment

ValuePurpose
cc-nameCardholder name
cc-numberCard number
cc-expExpiration date (MM/YY)
cc-exp-monthExpiration month
cc-exp-yearExpiration year
cc-cscSecurity code (CVV/CVC)
cc-typeCard type (Visa, Mastercard, etc.)
<fieldset> <legend>Payment</legend> <label for="cc-name">Name on card</label> <input type="text" id="cc-name" autocomplete="cc-name" /> <label for="cc-number">Card number</label> <input type="text" id="cc-number" autocomplete="cc-number" inputmode="numeric" /> <label for="cc-exp">Expiration</label> <input type="text" id="cc-exp" autocomplete="cc-exp" placeholder="MM/YY" /> <label for="cc-csc">Security code</label> <input type="text" id="cc-csc" autocomplete="cc-csc" inputmode="numeric" /> </fieldset>

Authentication

Use current-password for sign-in forms and new-password for registration or password-change forms. This distinction helps password managers generate and store passwords correctly.

ValuePurpose
usernameUsername or account identifier
current-passwordExisting password (sign-in)
new-passwordNew password (registration or change)
one-time-codeSMS or email verification code
<form class="stacked"> <label for="username">Username</label> <input type="text" id="username" autocomplete="username" /> <label for="current-pw">Password</label> <input type="password" id="current-pw" autocomplete="current-password" /> <button type="submit">Sign in</button> </form> <!-- Registration form --> <form class="stacked"> <label for="new-user">Username</label> <input type="text" id="new-user" autocomplete="username" /> <label for="new-pw">Password</label> <input type="password" id="new-pw" autocomplete="new-password" /> <button type="submit">Create account</button> </form>

One-Time Codes

The one-time-code value triggers platform-specific autofill from SMS or email. On iOS, the verification code appears directly in the keyboard suggestions. On Android, it appears as a notification action. Pair with inputmode="numeric" for the right keyboard.

<!-- SMS / email verification code --> <label for="otp">Verification code</label> <input type="text" id="otp" autocomplete="one-time-code" inputmode="numeric" pattern="[0-9]{6}" maxlength="6" />

Special Values

ValueEffect
onBrowser determines the autocomplete type (default)
offDisable autofill for this field

Note: Browsers may ignore autocomplete="off" for login fields. If you need to prevent autofill on a non-login field, use a non-standard value like autocomplete="nope" as a workaround.

See Also