HTML <input type="password"> Last Updated : 11 Jul, 2025 Comments Improve Suggest changes 1 Likes Like Report HTML <input type="password"> is used to specify the password field of the input tag. Password should be served over the HTTPS pages because it includes the sensitive information of the user.Note: We can add the <label> tag for improved accessibility.Syntax<input type="password">Example: We are using the HTML <input type="password"> to create a password field where characters are masked, enhancing security by hiding sensitive information like passwords from plain view. HTML <!DOCTYPE html> <html> <body> <h3>HTML input type="password" Example</h3> <form action="/action_page.php" method="post"> <label for="email">Email:</label> <input type="email" name="email" placeholder="Email Address" required pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,}$"> <br> <br> <label for="paswword">Password:</label> <input type="password" name="password" placeholder="Password" required> <br> <br> <input type="submit" value="Login"> </form> </body> </html> OutputHTML input type="password" Example OutputNote: Always ensure that forms containing sensitive information, such as passwords, are served over HTTPS to protect user data.Tips for Password Input in HTMLHere are a few tips for using <input type="password">:Password Input in HTML Forms: Use <input type="password"> to collect password information securely in HTML forms. This masks the entered text for privacy.Hide Password in HTML: Password masking is done automatically with <input type="password">, preventing the password from being visible in plain text and enhancing security.Supported BrowsersChrome 1 and aboveEdge 12 and aboveFirefox 1 and aboveSafari 1 and aboveOpera 2 and above Create Quiz Comment M manaschhabra2 Follow 1 Improve M manaschhabra2 Follow 1 Improve Article Tags : Web Technologies HTML HTML-Attributes Explore HTML BasicsHTML Introduction4 min readHTML Editors4 min readHTML Basics7 min readStructure & ElementsHTML Elements4 min readHTML Attributes7 min readHTML Headings3 min readHTML Paragraphs3 min readHTML Text Formatting4 min readHTML Block and Inline Elements3 min readHTML Charsets4 min readListsHTML Lists3 min readHTML Ordered Lists5 min readHTML Unordered Lists4 min readHTML Description Lists3 min readVisuals & MediaHTML Colors11 min readHTML Links Hyperlinks2 min readHTML Images7 min readHTML Favicon4 min readHTML Video4 min readLayouts & DesignsHTML Tables10 min readHTML Iframes4 min readHTML Layout4 min readHTML File Paths3 min readProjects & Advanced TopicsHTML Forms5 min readHTML5 Semantics5 min readHTML URL Encoding4 min readHTML Responsive Web Design11 min readTop 10 Projects For Beginners To Practice HTML and CSS Skills8 min readTutorial ReferencesHTML Tags - A to Z List15+ min readHTML Attributes Complete Reference8 min readHTML Global Attributes5 min readHTML5 Complete Reference8 min readHTML5 MathML Complete Reference3 min readHTML DOM Complete Reference15+ min readHTML DOM Audio/Video Complete Reference2 min readSVG Element Complete Reference5 min readSVG Attribute Complete Reference8 min readSVG Property Complete Reference7 min readHTML Canvas Complete Reference4 min read Like