How To Reveal Your Masked Password Using JavaScript


How To unmask the password saved in your browser which you might have forgotten. Suppose you forgot the password after saving in your favorite browser. Every time you visit your preferred site you are prompted to put the password but that work was done by the browser to help you. Now, what if your PC is formatted and there is no backup whatsoever. In this case you browser (newly installed) won’t be able to remember the password for you and you need to provide it yourself. Just because you have forgotten or lost your password you are barred from your favorite site.

In such scenario you can do nothing but ask for the password assistance for the site but in case you are interested in unmasking the password form your browser then you can simply use some JavaScript tricks to unmask your password.


Companies who work hard to increase their user friendly features tend to think that by securing the password they are doing good but eventually end up loosing business due to login failures. If a user is told 2-3 times to provide correct password which he/she might have forgotten they will feel irritated and may turn up to another company (that’s a well known fact).

If you put javascript: at the beginning of that, and delete all the new lines so that it becomes a one-liner, you can delete the text in your browser’s address bar and paste the JavaScript snippet in the address bar instead, then hit the Enter key. This will cause masked passwords to be revealed.


If you expect to use this often, you can create a bookmark button in your Firefox Bookmarks Toolbar easily enough. Start by creating a new bookmark — any bookmark will do, though you may want to choose one for a page without a favicon. Then:

  1. Right-click on the new bookmark button and select Properties. The title bar for the bookmark’s Properties dialog will still show the name of the bookmark’s original web page while you make edits, but don’t worry about that.
  2. Change the text in the Name field to Unmask (or whatever else you want it to say).
  3. Change the text in the Location field the same way you would for the browser address bar, as described above.<
  4. Clear the Keyword and Description fields, and fill them with whatever you like (or nothing at all).
  5. Click the Save Changes button


Cool. Any time you want to see the password text you type into a masked password field, now, you can just click the Unmask bookmark button in your Bookmark Toolbar.

In Firefox, you can also just drag and drop this link to your Bookmark Toolbar to get the same effect, if you like:


You are, unfortunately, on your own for figuring out how to do any of this in other browsers.

Finally, if you are a web developer and you think it is a good idea to give your site’s visitors the ability to unmask passwords when they try to log in, you can always create an Unmask Password link using the above JavaScript snippet. I recommend thinking long and hard about that before making the option available, however.

As a final warning, keep in mind that when you walk away from your computer with your password on the screen, the fact that it is masked may not stop someone else from getting your password using something like this JavaScript trick. Most software security techniques, no matter how useful in a networked world, are not proof against physical access to the machine.

Please leave me a comment and let me know if the above technique help you in unmasking your forgotten password. Subscribe to our RSS to receive latest updates in your mailbox.

0 I like it
0 I don't like it