What is a password field?
A password field is a single-line text field that masks what you type, showing dots instead of characters. It’s used for passwords, PINs typed on a keyboard, and other secrets like an API keyAPI keyA fixed secret string that identifies an app or partner calling an API, usually sent in a header.Open in glossary → or a card’s security code.
It comes in two flavors, and they behave differently:
- Current password (login, confirm before deleting the account): the user types or autofills a password that already exists. It must accept it exactly as it was saved.
- New password (sign-up, change password, reset): the user invents one. The field shows the rules, maybe a strength meter, and password managers offer to generate one.
Anatomy
New password
- At least 12 characters
- Not a commonly used password
- Doesn’t contain your email name 4
- 1
Label
A visible, permanent label ("Password", "New password"). The placeholder is not a label.
- 2
Masked value
Each character is shown as a dot. The field must still accept typing, paste and autofill.
- 3
Show / hide toggle
Reveals the password. Needs a name ("Show password"), a state, a 44 pt / 48 dp touch area, and must keep the cursor where it was.
- 4
Password rules
Shown before the user types, then ticked off live. Not a surprise after the first failed attempt.
- 5
Caps Lock warning
Web and desktop: a hint when Caps Lock is on, so users don’t lock themselves out by accident.
- 6
Autofill / password manager
The system offers a saved or a generated strong password. Only works if the field is marked up correctly.
How it differs from similar components
| Component | What’s different | Typical use |
|---|---|---|
| Password field | Masked, never autocorrected, managers fill it | Login, sign-up, change password |
| Text field | Shows the value, may autocorrect | Name, email, notes |
| One-time code field | Digits only, often split boxes, SMS autofill | 2FA codes |
| PIN pad | On-screen digits, fixed length | App lock, card PIN |
Dev note
iOS calls it a secure text field (isSecureTextEntry in UIKit, SecureField in SwiftUI). Android uses an EditText with inputType="textPassword", or a Material TextInputLayout with a password toggle. On the web it’s <input type="password">. Screen readers announce it as “secure text field” or “password”.
Check this part
Which screen uses a "new password" field rather than a "current password" field?
What makes a password field different from a normal text field?