A simple JavaScript bookmarklet that allows you to toggle the visibility of password fields on any webpage.
- First click: Reveals all hidden password fields by converting them to text fields
- Second click: Hides all revealed password fields by converting them back to password fields
- Copy the bookmarklet code below
- Create a new bookmark in your browser
- Set the bookmark name to "Show Passwords" (or any name you prefer)
- Paste the code as the bookmark URL/location
javascript:(function()%7Blet%20shownPasswords%20%3D%20document.querySelectorAll('input%5Bdata-is-password-field%5D')%3B%0Aif%20(shownPasswords.length%20!%3D%200)%20%7B%0A%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20shownPasswords.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20shownPasswords%5Bi%5D.type%20%3D%20'password'%3B%0A%20%20%20%20delete%20shownPasswords%5Bi%5D.dataset.isPasswordField%3B%0A%20%20%7D%0A%7D%20else%20%7B%0A%20%20let%20passwordElements%20%3D%20document.querySelectorAll('input%5Btype%3D%22password%22%5D')%3B%0A%20%20for%20(let%20i%20%3D%200%3B%20i%20%3C%20passwordElements.length%3B%20i%2B%2B)%20%7B%0A%20%20%20%20passwordElements%5Bi%5D.type%20%3D%20'text'%3B%0A%20%20%20%20passwordElements%5Bi%5D.dataset.isPasswordField%20%3D%20true%3B%0A%20%20%7D%0A%7D%7D)()%3B
- Navigate to any webpage with password fields
- Click the bookmarklet to reveal all password fields
- Click the bookmarklet again to hide all password fields
- Password verification: Check that you've typed your password correctly
- Password requirements: Verify your password meets website requirements while typing
- Form debugging: See what's actually in password fields during development or testing
- Accessibility: Temporarily make passwords visible for users who have difficulty with hidden text
The bookmarklet uses a toggle mechanism:
- Show passwords: Finds all
input[type="password"]
elements, changes them totype="text"
, and marks them with adata-is-password-field
attribute - Hide passwords: Finds all elements with the
data-is-password-field
attribute, changes them back totype="password"
, and removes the marker attribute
This bookmarklet works in all modern browsers including:
- Chrome
- Firefox
- Safari
- Edge
This bookmarklet only affects the current webpage temporarily. It does not store, transmit, or permanently modify any passwords. The password visibility is reset when you refresh the page.