How To See Hidden Password Behind Asterisks

Today almost all browsers come with a feature which allows the user to save website password. So when the user tries to access that particular website, the username and password field is already populated with the previously entered information.

Though this feature is helpful and saves your time, it is not really a secure option. If you have a personal computer then there’s no problem in using this feature. But if your device is used by different users then its really bad idea to save password on the web browser.

Because its really quite simple to extract the password by running a simple JavaScript.

#1) Using Javascript

In this post i will provide a simple JavaScript that you can use to retrieve or expose the hidden password. This can really be useful to recall the password in case you have forgotten it or if you want to know the password of someone else’s account (assuming that you have access to the PC and the user had stored the login details in the browser before).

First access the web page which contains the login credentials. An example image is shown below.

login to gmail omkar bhagat

Now in the address bar, type in the following:


Check the image below.

javascript in address bar

After typing javascript and colon, just give a space and copy paste the following code in front of it.

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(‘Password not found in ‘ +  g + ‘ forms’);}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!=”){prompt(‘The Password is ‘,  s)}else{alert(‘Password is blank’)}return true;}}

So it would result into something like this:

paste javascript in address bar

Then after just hit Enter. This would show you the password as follows:

display password behind asterisk

#2) Using Inspect Element

First access the web page which contains the login credentials. An example image is shown below.

login to gmail omkar bhagat

Right Click on the password field and hit Inspect Element.

inspect element to show password

After clicking on inspect element, you will get a window at the bottom of your browser. It would look similar to the image below:

input type password field

Double Click on ‘password‘ text.

edit input type password

Now hit Backspace and hit Enter.

This would expose the password field. That is, all asterisk or dotted mask will be removed. And the original password hidden under the asterisk or dots will be exposed as shown in the image below.

expose the password field

So i hope this helps. If you have any questions or doubts, feel free to comment below. And do subscribe to blog updates for more amazing tricks and posts.

3 Replies to “How To See Hidden Password Behind Asterisks”

Comments are closed.