Tutorials References Exercises Bootcamps Videos Menu
Sign Up Create Website Get Certified Upgrade

HTML <input type="password">

❮ HTML <input> type attribute


Define a password field (characters are masked):

<label for="pwd">Password:</label>
<input type="password" id="pwd" name="pwd">
Try it Yourself »

Definition and Usage

The <input type="password"> defines a password field (characters are masked).

Note: Any forms involving sensitive information like passwords should be served over HTTPS.

Tip: Always add the <label> tag for best accessibility practices!

Browser Support

type="password" Yes Yes Yes Yes Yes


<input type="password">

❮ HTML <input> type attribute