Back to compare picker

Password input vs Text input vs Inline validation vs Error summary

Use password input when a user must enter an existing secret or PIN-like memorized secret; use text input for non-secret text, inline validation for field-level correction, and error summary for reachable form-level recovery.

Learn the decision

Match the interaction to the person's task

Use password input when a user must enter an existing secret or PIN-like memorized secret; use text input for non-secret text, inline validation for field-level correction, and error summary for reachable form-level recovery.

Password input

Use it when: The user needs to enter an existing password, passphrase, or PIN-like memorized secret.

Make this state clear: Initial hidden state with label, autocomplete purpose, spellcheck off, autocapitalization off, and show control.

Observe the result: The person reaches a clear outcome.

Study the full pattern →

Text input

Use it when: The answer is short and user-authored.

Make this state clear: Empty untouched state with persistent label and optional hint.

Observe the result: A user leaves the required field blank, sees an error only after submit, returns to the same field, and their later typed value clears the error.

Study the full pattern →

Inline validation

Use it when: A single field has a specific correctable problem.

Make this state clear: Invalid field with preserved user value and adjacent correction text.

Observe the result: Validation appears after blur or submit when it helps correction.

Study the full pattern →

Error summary

Use it when: Form submission can produce one or more errors.

Make this state clear: Failed-submit state with summary visible near the form heading.

Observe the result: After failed submit, focus or reading order makes the summary discoverable before users scan the form.

Study the full pattern →

Practice the judgment: Imagine this situation: A login form uses a normal text input, so the password remains visible in the room and may be saved as ordinary form text. Write the person's goal, choose one of these patterns, and show the state that helps the person continue. Use the decision rules and source trail below to explain your choice.

Review the underlying principle →

Decision dimensions

Dimension Password inputText inputInline validationError summary
UI or UX UI + UX - Authentication secret entry controlUI + UX - Single-line freeform data-entry controlUI + UX - Field-level validation feedbackUI + UX - Form recovery summary
UI guidance Render password entry as a labelled password field that is hidden by default, uses the correct autocomplete purpose, offers a clear show and hide control, disables spellcheck and automatic capitalization, and keeps helper and error text connected to the input.Render a persistent label, appropriately sized single-line input, optional hint, visible focus state, and nearby error text that is programmatically associated with the field.Render a labeled field with hint text, field-adjacent error text, invalid styling, preserved value, and corrected state.Render a top-of-form summary block with heading, linked error list, and matching field-level error messages.
UX guidance Use password input when a user enters an existing secret to sign in, reauthenticate, unlock a protected action, or confirm account ownership.Let users edit normally, validate after interaction or attempted submit, preserve their typed value after errors, and explain exactly how to fix invalid or missing text.Help the person reach a clear task outcome.Move users from the summary to the exact field, group, or first invalid control that needs correction.
Good UI A reauthentication dialog asks for Current password, lets the user show it temporarily, accepts a pasted manager value, and clears the field after an incorrect attempt.A reference-name field has a visible label, hint, medium width, focus ring, and error message beneath the hint when submitted empty.Error text appears next to the field with readable spacing, persistent label, hint text, and the invalid value still visible.Top-of-form summary with a clear heading, linked error list, and matching inline field messages.
Bad UI A login form uses a normal text field named Password and leaves the secret visible on screen.The only instruction is placeholder text that disappears when the user starts typing.Error message appears far from the field it describes.Summary and field messages visually disconnected or contradictory.
Good UX The person reaches the intended result with clear feedback.A user leaves the required field blank, sees an error only after submit, returns to the same field, and their later typed value clears the error.Validation appears after blur or submit when it helps correction.After failed submit, focus or reading order makes the summary discoverable before users scan the form.
Bad UX A failed login page says the password is wrong, confirming that the username exists.Validation fires on the first focus event and blocks typing before the user has had a chance to answer.Showing errors before users type.Only showing errors below the fold.
Best fit The user needs to enter an existing password, passphrase, or PIN-like memorized secret.The answer is short and user-authored.A single field has a specific correctable problem.Form submission can produce one or more errors.
Avoid when The task is choosing a new password and needs creation-specific guidance, strength feedback, and blocklist rejection.The answer is a paragraph, comment, address block, or explanation requiring multiple lines.The main recovery task is finding several errors across a submitted page.The message is a system failure, permission problem, or outage rather than a validation issue.
Required state Initial hidden state with label, autocomplete purpose, spellcheck off, autocapitalization off, and show control.Empty untouched state with persistent label and optional hint.Invalid field with preserved user value and adjacent correction text.Failed-submit state with summary visible near the form heading.
Accessibility burden Use a visible label that names the password purpose, such as Password or Current password.Associate every text input with a visible label or equivalent accessible name that matches the visible question.Expose invalid state on the input and connect error text to the field description where possible.Use a heading and alert behavior that makes the summary discoverable.
Common misuse Using type text for passwords.Using placeholder text as the only label or instruction.Showing field errors before users have interacted with the control.Replacing field-level messages with only a top-level summary.

Password input

UI or UX
UI + UX - Authentication secret entry control
UI guidance
Render password entry as a labelled password field that is hidden by default, uses the correct autocomplete purpose, offers a clear show and hide control, disables spellcheck and automatic capitalization, and keeps helper and error text connected to the input.
UX guidance
Use password input when a user enters an existing secret to sign in, reauthenticate, unlock a protected action, or confirm account ownership.
Good UI
A reauthentication dialog asks for Current password, lets the user show it temporarily, accepts a pasted manager value, and clears the field after an incorrect attempt.
Bad UI
A login form uses a normal text field named Password and leaves the secret visible on screen.
Good UX
The person reaches the intended result with clear feedback.
Bad UX
A failed login page says the password is wrong, confirming that the username exists.
Best fit
The user needs to enter an existing password, passphrase, or PIN-like memorized secret.
Avoid when
The task is choosing a new password and needs creation-specific guidance, strength feedback, and blocklist rejection.
Required state
Initial hidden state with label, autocomplete purpose, spellcheck off, autocapitalization off, and show control.
Accessibility burden
Use a visible label that names the password purpose, such as Password or Current password.
Common misuse
Using type text for passwords.

Text input

UI or UX
UI + UX - Single-line freeform data-entry control
UI guidance
Render a persistent label, appropriately sized single-line input, optional hint, visible focus state, and nearby error text that is programmatically associated with the field.
UX guidance
Let users edit normally, validate after interaction or attempted submit, preserve their typed value after errors, and explain exactly how to fix invalid or missing text.
Good UI
A reference-name field has a visible label, hint, medium width, focus ring, and error message beneath the hint when submitted empty.
Bad UI
The only instruction is placeholder text that disappears when the user starts typing.
Good UX
A user leaves the required field blank, sees an error only after submit, returns to the same field, and their later typed value clears the error.
Bad UX
Validation fires on the first focus event and blocks typing before the user has had a chance to answer.
Best fit
The answer is short and user-authored.
Avoid when
The answer is a paragraph, comment, address block, or explanation requiring multiple lines.
Required state
Empty untouched state with persistent label and optional hint.
Accessibility burden
Associate every text input with a visible label or equivalent accessible name that matches the visible question.
Common misuse
Using placeholder text as the only label or instruction.

Inline validation

UI or UX
UI + UX - Field-level validation feedback
UI guidance
Render a labeled field with hint text, field-adjacent error text, invalid styling, preserved value, and corrected state.
UX guidance
Help the person reach a clear task outcome.
Good UI
Error text appears next to the field with readable spacing, persistent label, hint text, and the invalid value still visible.
Bad UI
Error message appears far from the field it describes.
Good UX
Validation appears after blur or submit when it helps correction.
Bad UX
Showing errors before users type.
Best fit
A single field has a specific correctable problem.
Avoid when
The main recovery task is finding several errors across a submitted page.
Required state
Invalid field with preserved user value and adjacent correction text.
Accessibility burden
Expose invalid state on the input and connect error text to the field description where possible.
Common misuse
Showing field errors before users have interacted with the control.

Error summary

UI or UX
UI + UX - Form recovery summary
UI guidance
Render a top-of-form summary block with heading, linked error list, and matching field-level error messages.
UX guidance
Move users from the summary to the exact field, group, or first invalid control that needs correction.
Good UI
Top-of-form summary with a clear heading, linked error list, and matching inline field messages.
Bad UI
Summary and field messages visually disconnected or contradictory.
Good UX
After failed submit, focus or reading order makes the summary discoverable before users scan the form.
Bad UX
Only showing errors below the fold.
Best fit
Form submission can produce one or more errors.
Avoid when
The message is a system failure, permission problem, or outage rather than a validation issue.
Required state
Failed-submit state with summary visible near the form heading.
Accessibility burden
Use a heading and alert behavior that makes the summary discoverable.
Common misuse
Replacing field-level messages with only a top-level summary.
Decision rules
  • Prefer password input when the value is a secret used for authentication, reauthentication, unlocking a protected action, confirming account ownership, or entering a PIN-like memorized secret.
  • Prefer text input when the value is meant to remain visible, searchable, copied into review pages, or stored as ordinary profile or form text; do not obscure ordinary names, emails, references, or account labels as passwords.
  • Prefer inline validation to explain missing password, disabled password-manager support, Caps Lock warning, or field-level entry problems next to the password field, but do not reveal whether the username or password was the wrong credential after a failed login.
  • Prefer error summary when a sign-in or account form has multiple fields and the user needs a keyboard-reachable summary that links to the password or username field after submit.
  • Use current-password autocomplete for existing sign-in passwords, new-password for creating or changing a password, and one-time-code for short-lived codes rather than treating every secret field alike.
  • Hide password text by default, provide a user-controlled show and hide action, and return the field to password type before submit if it was visible.
  • Allow paste, autofill, and password managers; blocking paste or disabling manager features makes strong generated passwords harder to use.
  • Disable spellcheck and automatic capitalization so visible password text is not modified or sent through spelling tools.
  • Clear the password value after a failed login attempt and show a combined account-details error instead of revealing whether the password alone was wrong.
  • Do not use a password field as a formatting mask, secret note field, account recovery substitute, or review-before-submit value; password entry owns secret capture and should not display the secret later.
Inspect live examples
Failure modes
  • A login form uses a normal text input, so the password remains visible in the room and may be saved as ordinary form text.
  • A form blocks paste, preventing password-manager use and encouraging weaker typed passwords.
  • A failed sign-in message says the password was wrong, helping attackers enumerate valid usernames.
  • The password remains visible after submit, browser Back, or failed authentication.
  • Spellcheck or autocapitalization changes the entered secret or exposes it to third-party tooling.
  • A page uses inline validation to reject password characters that existing users already have in valid stored passwords.

Saved items