# Password Input

A password input accepts a secret while supporting password managers, paste, clear requirements, controlled reveal, validation, and safe handling.

- Type: artifact
- Domain: Experience & interface
- Level: Intermediate
- Last reviewed: 2026-10-06
- Original: [Soroush’s Product Wiki](<https://wiki.soroush.uk/topic/password-input/>)

## What it means

A password input is a text-entry control whose value is visually obscured by default because it contains an authentication secret. A complete pattern distinguishes current from new passwords, signals its purpose to browsers and password managers, permits generated or pasted values, and may provide a labeled control to reveal and hide the secret.

## Why it matters

Password fields sit at a high-friction, high-consequence point in account access. Supporting password managers, paste, usable reveal, and clear validation reduces entry errors and weak coping strategies without pretending that masking alone secures the credential.

## When to use it

Use a password input only for password authentication or creation. Identify current and new-password purposes correctly, hide the value by default in shared settings, and offer reveal when users benefit from checking entry. Do not use password fields for one-time codes, PINs, or other data with different input and storage rules.

## How it works

1. Label the field by purpose and identify whether it expects a current or new password for autofill tools.
2. Allow password managers, generation, autofill, and paste without silently truncating or transforming the value.
3. Hide characters by default and make reveal a labeled, stateful button with an appropriate announcement.
4. State creation requirements before entry and validate them without blocking valid characters or exposing the secret.
5. Protect the value from logging and accidental persistence, then test browsers, managers, mobile keyboards, screen readers, and error recovery.

## A practical example

A sign-in form labels one field Password, marks it as the current-password purpose, permits a password manager to fill it, and offers a Show password button. A registration form uses new-password autocomplete and explains minimum length before entry rather than rejecting pasted generated passwords.

## Where it breaks

A reveal control can expose a secret to nearby observers, browser and password-manager integrations vary, and interface guidance cannot compensate for insecure credential storage or recovery. Password authentication itself may be inappropriate when stronger or lower-friction methods are available.

## Common mistakes

- Blocking paste or password-manager autofill.
- Using the wrong autocomplete purpose for current and new passwords.
- Silently truncating passwords with a maximum-length field constraint.
- Adding an unlabeled eye icon whose visible and announced state disagree.

## Sources

1. [Password input](<https://design-system.service.gov.uk/components/password-input/>) — GOV.UK Design System · Institutional design system
2. [NIST Special Publication 800-63B](<https://pages.nist.gov/800-63-4/sp800-63b.html>) — National Institute of Standards and Technology · Standard

## Related topics

- [Form Validation](<https://wiki.soroush.uk/topic/form-validation/>)
- [Accessible Name](<https://wiki.soroush.uk/topic/accessible-name/>)
- [Error Recovery](<https://wiki.soroush.uk/topic/error-recovery/>)
