web analytics
Thursday, September 11, 2025
HomeComputer Tricks & PranksView Hidden Passwords Behind Asterisks

View Hidden Passwords Behind Asterisks

When entering a password on a login page or web form, it is usually masked with asterisks(*) to prevent people around you from seeing what you typed. However, there are times when you may want to view the hidden password to ensure you’ve entered it correctly. Or you may want to view a password that has been auto-filled by the browser using saved login information.

Although you can view the saved passwords through the browser’s password manager, the process can be time-consuming. However, by using JavaScript, you can easily view the password directly on the login form – especially useful if you’ve forgotten it and you may want to memorize the credential for that specific website.

While there are several freeware tools available for this purpose, most of them can pose security risks. Instead, you can just use a simple and safe JavaScript code snippet that requires no installation and works directly in your browser.

View Hidden Passwords Behind Asterisks

The following JavaScript code helps you display hidden password characters (masked as asterisks) directly on the screen. It works majorly with all browsers such as Firefox, Google Chrome, Opera, Safari, and Edge.

  1. Copy the code below.
javascript: var p=r(); function r(){var g=0;var x=false;var x=z(document.forms);g=g+1;var w=window.frames;for(var k=0;k<w.length;k++) {var x = ((x) || (z(w[k].document.forms)));g=g+1;}if (!x) alert('There are no passwords found in forms on this page.');}function z(f){var b=false;for(var i=0;i<f.length;i++) {var e=f[i].elements;for(var j=0;j<e.length;j++) {if (h(e[j])) {b=true}}}return b;}function h(ej){var s='';if (ej.type=='password'){s=ej.value;if (s!=''){alert('Password found on this page:\n\n' +s)}else{alert('Password is blank')}return true;}}
  1. Paste it into your browser address bar.
  2. Add javascript: at the beginning, if it gets removed automatically.
  3. Press Enter.

Note: Modern browsers may restrict JavaScript execution directly from the address bar for security reasons. In such cases, use the bookmark method below.

Add a Bookmarket for Quick Access

To make it even easier, you can save the above script as a bookmark.

Option 1: Drag and Drop

Show Password – Drag the link to your bookmarks toolbar

Option 2: Manually Create a Bookmark

  1. Right-click your bookmarks bar and select “Add Page” or “Add Bookmark”.
  2. Name it something like “Show Password”.
  3. Paste the entire JavaScript code as the URL.
  4. Save it.
Reveal Hidden Asterisk Password Javascript to Bookmark

Important Note: Use this only on pages where you’re authorized to access passwords. Never use this trick on someone else’s account or system without their knowledge.

Roshan Karkera
Roshan Karkera
Roshan Karkera is a passionate blogger and a software engineer by profession, driven by a love for technology, science, and continuous learning. With a strong belief in sharing knowledge, he started this blog to inspire and inform readers through simple, insightful content. When he's not coding or exploring the latest in tech, you’ll find him writing about ideas that matter. Connect with him on Twitter or your favorite social platform to stay updated.
RELATED ARTICLES

9 COMMENTS

  1. @ mehul, I never tested on IE 8 and 9. However this code is not working for IE 8 and 9. I will get a fix for IE soon if possible.

    •  @c28a340dcf91e0a2fe146c101e1c86fe:disqus

      In Firefox 11 and later versions, the code is not
      working, due to some security measures. Firefox will not respond to this
      JavaScript code. Alternatively, you can use Firefox console, Press Ctrl + Alt + K and paste the code and press Enter.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular