diff --git a/modules/user/user.js b/modules/user/user.js
index d182066ad8262c12b89ca5ace7470e6436b71082..4cf981611e917b43c354a71326b9ea762d6bfcfb 100644
--- a/modules/user/user.js
+++ b/modules/user/user.js
@@ -93,6 +93,8 @@ Drupal.behaviors.password = {
  * Returns the estimated strength and the relevant output message.
  */
 Drupal.evaluatePasswordStrength = function (password, translate) {
+  password = $.trim(password);
+
   var weaknesses = 0, strength = 100, msg = [];
 
   var hasLowercase = /[a-z]+/.test(password);