Password Strength Indicator and Generator
Sometimes you want to show your user the strength of their password and although there a quite a few jQuery “plugins” that do this there are none – that I’ve found – that let you set the class of an element so that you can do a graphical representation of the strength.
What I have put together is some code that I have been using on a few projects and turned it into a rough plugin. I say a rough plugin because it is very basic and not entirely flexible; let’s just call it a proof-of-concept.
Live Demo of Password strength indicator and generator
In the example about you will see two password boxes and with them you have a generate password link and an icon showing you the strength of your password.
The first example you notice that I have a basic indicator showing the strength is the form a colors blocks going from green to red with red being the strongest indicator. (I got these images from the cpanel password changer)

This is what you would normally see and it is fine, but what if your design is much like my current design where you are featuring trees?
In the second example we simply swap out the icon for a tree that has four levels and when the password is real strong the tree is completely filled in with red.

Have a look at the code:
The Code for Password strength indicator and generator
By default the plugin will work off of ten default classes that you can set the css for which you can do an image sprite like I did above. Or maybe just a DIV with specific colors and widths that will illustrate a growing strength of a password.
Final Thoughts
The point of this post is to show you that you don’t need to limit yourself to what is already out there, expand your thinking to include all possibilities and not just prepackaged ones.
With that said, what other possibilities do we have for a simple thing like a password strength indicator? Hmm… maybe doing a meter type thing that goes from zero to a hundred and just rotate the pointer much like the clock example?
back to beginning of this post back to skip to links


1. Chris Coyier