autocomplete
A hint that identifies the expected data type.
Learn Autocomplete with practical examples for form structure, input behavior, validation, autocomplete, accessibility, backend safety and live practice.
HTML forms
The autocomplete attribute tells the browser what kind of information a field expects. That can make forms faster, especially on mobile.
Good autocomplete values help with names, email, phone numbers, addresses, usernames, current passwords and new passwords.
Autocomplete is not decoration. It is a real usability feature that reduces typing, mistakes and friction.
A hint that identifies the expected data type.
Lets browsers fill the user email address.
Lets browsers fill phone information.
Helps password managers generate and store new passwords.
Syntax and behavior
The best value depends on the field purpose. A login password and a signup password should not use the same token.
<label for="full-name">Full name</label> <input id="full-name" name="name" autocomplete="name"> <label for="email">Email</label> <input id="email" name="email" type="email" autocomplete="email"> <label for="password">Choose password</label> <input id="password" name="password" type="password" autocomplete="new-password">
<form autocomplete="off"> <input name="email" type="email"> <input name="password" type="password"> </form>
Rules that matter
Strong form markup is readable, accessible, secure by design and easy to connect to real server-side validation.
Autocomplete can fill names more accurately with the right token.
Do not make browsers guess from placeholders.
This helps password managers fill existing credentials.
This helps password managers generate and save new credentials.
Turning autocomplete off often hurts users.
Address forms can use street-address, postal-code, address-level2 and more.
Production thinking
This matters because the easiest form is often the one the user does not have to type from scratch.
Autocomplete can reduce cognitive load and typing effort for many users.
Use correct tokens on login, signup and checkout forms. Password-manager compatibility is part of production quality.
Autocomplete does not directly affect ranking, but it improves task completion and trust on conversion pages.
Live code lab
Edit the HTML or CSS, then use Run to refresh the preview. The preview is isolated, so links and forms stay inside this practice area.
Mini assignment
Practice assignment
Try it yourself
Self-check
Do not only read this page. Answer these questions out loud or write the answers in your own notes. If one answer feels vague, revisit the examples before moving on.