Elementary Standards
HTMLCSSWeb StandardsSEOBlogStart reading
Home / Blog / The HTML autocomplete Attribute: Why Checkout Forms Still Get It Wrong
HTML

The HTML autocomplete Attribute: Why Checkout Forms Still Get It Wrong

The spec gives every form field a standard autofill vocabulary — most checkout forms still ignore it, or disable it outright.

6 min read·2026-11-30·James Webb

A mobile shopper reaches a checkout form, taps the address field, and gets nothing — no suggestion, no shortcut, just a blank input and a keyboard. They retype a street address they've typed into a hundred other forms, because the markup gave the browser no way to recognize what that field was for. TL;DR: autocomplete isn't a boolean toggle, it's a standardized vocabulary of tokens — name, street-address, cc-number, and dozens more — that tells the browser exactly what each field means, and most teams either skip it or kill it with autocomplete="off".

That gap is rarely intentional. It's usually a field built with a generic name attribute and no thought given to what the browser needs to recognize it, or a well-meaning engineer who set autocomplete="off" years ago to stop a browser from suggesting the wrong saved value, and never revisited it. It's also one of the first things worth auditing when you're vetting teams that offer e commerce web development services — autocomplete correctness on checkout is a five-minute fix that most agencies still skip.

Here's what the attribute actually standardizes, why turning it off is almost always the wrong call, and the exact token list a checkout form needs.

What autocomplete Actually Standardizes

autocomplete is not a boolean. Beyond the handful of fields where on/off is the whole story, most inputs take one of a defined set of tokens — email, tel, postal-code, cc-exp — that the HTML spec assigns a precise meaning to. Setting autocomplete="email" on a text input isn't a hint or a convention a few browsers happen to honor; it's the field declaring, in a vocabulary every major browser implements the same way, exactly what kind of value belongs there.

This is a different standard from form validation. A required attribute or a pattern check decides whether a submitted value is acceptable; autocomplete decides what the browser should suggest before the user types anything at all. A form can have airtight validation and still fight the user on every field if the autofill vocabulary was never filled in.

Why autocomplete="off" Is Almost Always the Wrong Call

Setting autocomplete="off" doesn't just suppress one bad suggestion — it tells the browser not to offer any stored data for that field, full stop. On a checkout or signup form, that means every name, address, and card field the user would otherwise fill in two taps now has to be typed by hand. The commonly cited cost is a 40–60% slowdown in mobile checkout completion, and every extra second of typing on a phone is a point where a shopper decides the cart isn't worth it.

The instinct behind autocomplete="off" is usually reasonable on the surface: a browser suggested the wrong saved address once, so someone disabled autofill to make the annoyance stop. But a wrong suggestion is a labeling problem — the field needs a more specific or correctly scoped token — not a reason to remove autofill for everyone. The narrow case where off is genuinely correct is a one-time value the server will flatly reject if it's reused, such as a single-use verification code scoped to that session. "I don't want Chrome guessing" is not that case.

The Token Vocabulary Checkout Forms Actually Need

A checkout form only needs a small, fixed set of tokens, reused consistently. This covers the fields that show up on nearly every shipping and payment step:

Fieldautocomplete tokenNote
Full namenameA single combined field is more reliable for autofill than separate first/last inputs.
Street addressstreet-address or address-line1 / address-line2Use the line-split version when you need a dedicated apartment/suite field.
Cityaddress-level2Not city — that word isn't a recognized token.
State / regionaddress-level1Covers states, provinces, and equivalent regions internationally.
Postal codepostal-codeCovers ZIP codes and other postal formats.
CountrycountryPair with a select using ISO country values where possible.
EmailemailAlso triggers password-manager-linked suggestions on login-adjacent forms.
PhonetelBrowsers normalize formatting on their end; don't over-constrain with a rigid pattern.
Card numbercc-numberRequired for saved-card autofill to engage at all.
Expirycc-expUse cc-exp-month / cc-exp-year only if the fields are genuinely split.
Security codecc-cscBrowsers deliberately don't store this value — the token still helps focus and keyboard behavior.

How Do You Handle Two Address Blocks on One Page?

A checkout page with both a shipping and a billing address has two sets of the same fields, and the browser needs a way to tell them apart. The spec's answer is a custom section prefix added before the token: autocomplete="shipping address-line1" for one block, autocomplete="billing address-line1" for the other. This isn't a workaround bolted on after the fact — it's the mechanism the HTML spec defines specifically for this case, and it lets the browser keep two separate sets of saved values without either block overwriting the other's autofill.

<input name="ship-line1" autocomplete="shipping address-line1">
<input name="bill-line1" autocomplete="billing address-line1">

Does autocomplete Help Accessibility Too?

Yes, in a narrower way than people expect. Correct autofill means fewer fields a user has to re-enter by hand, which matters more for anyone relying on assistive technology or affected by a motor impairment, where typing itself carries a real cost. It's a useful side effect, not a substitute for the deeper accessibility work — labels, focus order, and error messaging — covered in a dedicated WCAG forms checklist.

A Worked Example — a Checkout Field Set

Here's a realistic shipping block with the tokens that actually make it autofill correctly, annotated:

<input name="full-name" autocomplete="shipping name">
<input name="street1" autocomplete="shipping address-line1">
<input name="street2" autocomplete="shipping address-line2">
<input name="city" autocomplete="shipping address-level2">
<input name="region" autocomplete="shipping address-level1">
<input name="postal" autocomplete="shipping postal-code">
<select name="country" autocomplete="shipping country">...</select>
<input name="phone" type="tel" autocomplete="shipping tel">

Note what's absent: no autocomplete="off" anywhere, no custom field names doing double duty as the autofill hint, and stable name attributes that don't get regenerated on every build. That last detail matters more than it sounds — a field whose name or id changes on every deploy can quietly break the browser's autofill heuristics even when the autocomplete token itself is correct.

Frequently Asked Questions

What does the HTML autocomplete attribute actually do?

It tells the browser what kind of data a field expects — a name, an email address, a shipping city — using a standardized vocabulary defined by the HTML spec. The browser uses that token to decide what to suggest from its stored autofill data, instead of guessing from the field's label or placeholder text.

Is autocomplete="off" ever the right choice?

Rarely, and almost never on a checkout or account form. The legitimate case is a one-time value the server will reject if reused, such as a single-use verification code tied to that specific session. Wanting to stop the browser from suggesting the wrong saved value is a labeling problem, solved by a more specific token, not a reason to disable autofill entirely.

What's the difference between autocomplete="name" and separate first/last name fields?

A single field with autocomplete="name" is more reliable for autofill because it matches how most browsers store a saved contact's full name as one string. Splitting into given-name and family-name fields is supported by the spec and necessary when your backend genuinely needs the parts separately, but it introduces more chances for the browser's guess to land on the wrong field.

How do I handle both a billing and a shipping address on the same page?

Prefix the token with a custom section name, such as autocomplete="shipping address-line1" and autocomplete="billing address-line1". This is the HTML spec's own mechanism for disambiguating two address blocks in one form, not a workaround, and it lets the browser keep the two sets of saved values separate.

Does autocomplete work without JavaScript?

Yes. Autofill driven by the autocomplete attribute is handled entirely by the browser, independent of any script on the page. It keeps working if JavaScript fails to load, is blocked, or hasn't finished executing yet, which is part of why it's worth getting right at the markup level rather than patching with a script-based autofill library.

Can I use custom values, or only the spec-defined tokens?

The field itself should use a spec-defined token where one exists, such as email or cc-number, because that's what browsers actually recognize for autofill. The custom-section prefix (like shipping or billing) is the one place the spec explicitly allows an author-chosen word, used only to group related fields, not to replace the standard value.

Does getting autocomplete right actually move conversion numbers?

It's one of the highest-leverage, lowest-effort fixes available on a checkout form. The documented cost of disabling autofill outright runs to a 40–60% slowdown in mobile checkout completion, and every extra field a mobile user has to retype by hand is a point where they can decide to abandon the cart instead.

Getting autocomplete right is one of the cheapest wins left in form design: no redesign, no new validation logic, just the correct token on fields that already exist. Run through the table above against your own checkout form, add the section prefixes where you have two address blocks, and stop reaching for off the next time a suggestion looks wrong — fix the token instead. For the full token grammar and edge cases beyond what a checkout form needs, the MDN autocomplete reference and web.dev's payment and address form guide are worth bookmarking.

Back to the blog
More notes

Keep reading