A strong password is essential to secure your online accounts and personal data. A strong password is longer, includes a combination of letters, numbers, and special characters, and avoids easily guessable patterns or dictionary words. Use our checker to assess and generate strong passwords.
You can check the strength of passwords programmatically in JavaScript by assessing factors like length, character variety, and unpredictability. Here's an example of how you can check the strength of a password:
function checkPasswordStrength(password) { let strength = 0; if (password.length >= 12) strength += 1; if (/[A-Z]/.test(password)) strength += 1; if (/[a-z]/.test(password)) strength += 1; if (/\d/.test(password)) strength += 1; if (/[!@#$%^&*(),.?":{}|<>]/.test(password)) strength += 1; if (strength === 5) { return 'Strong'; } else if (strength >= 3) { return 'Moderate'; } else { return 'Weak'; } } console.log(checkPasswordStrength("V3rY$tr0ngP@ssw0rd!2025")); // Output: Strong
You can easily generate a strong, random password using JavaScript. Here's an example of how you can generate a secure password programmatically:
function generatePassword(length = 12) { const charset = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()"; let password = ""; for (let i = 0; i < length; i++) { const randomIndex = Math.floor(Math.random() * charset.length); password += charset[randomIndex]; } return password; } console.log(generatePassword(16)); // Output: Randomly generated password like "Vb7*sd2!jRmT9zD#"