Widely availableSupported across all major browsers. Safe to use in production.

Overview

The <input type="password"> HTML element represents a field for users to enter a password. The password is hidden from view, typically replaced by dots or asterisks.

Browser support

Feature Desktop Mobile
Chrome
Edge
Firefox
Safari
Chrome Android
Safari iOS
1
12
1
1
18
1
html.elements.input.type_password.insecure_login_handling
Non-standard

Special handling of password inputs in insecure login pages

52
1+Supported (version) Not supported Has note Sub-feature descriptions sourced from MDN Web Docs (CC BY-SA 2.5)

Syntax

HTML
<label for="pw">Password:</label>
<input type="password" id="pw" name="password"
  minlength="8" required
  autocomplete="current-password">

Live demo

Pathwa-dinput

Password type in inputcontents maskfield.

PreviewFullscreen

Pathwa-dmain. Display

Pathwa-dfield. bottom to main displaypattern.

PreviewFullscreen

Login form

Email + pathwa-d. type roginUI.autocomplete attribute with.

PreviewFullscreen

Use cases

  • Using <input type="password">

    The <input type="password"> HTML element represents a field for users to enter a password. The password is hidden from view, typically replaced by dots or asterisks.

Cautions

  • May not be supported in older browsers.

Accessibility

  • Verify how this element is announced by screen readers.

Powered by web-features