Password strength analysis
Score passwords from 0 to 100 with strength labels and policy-aware validation feedback.

Lightweight password strength and policy analysis with typed ESM/CommonJS builds, personal-info blocking, and detailed validation feedback.
Features
PassGuardJS goes beyond checking whether a password matches a regex. It helps developers explain what is weak, what passed, and what the user can improve.
Score passwords from 0 to 100 with strength labels and policy-aware validation feedback.
Configure length limits, score thresholds, character requirements, banned terms, and custom rules.
Flag predictable passwords and extend the built-in list with your own blocked values.
Detect keyboard walks such as qwerty, asdf, and similar predictable patterns.
Catch repeated runs such as aaaaaa or 111111 before they pass a format-only check.
Block ascending or descending runs such as abcdef, 123456, and fedcba.
Compare passwords against names, emails, usernames, birth years, phone numbers, and locations.
Ships editor-friendly TypeScript definitions for browser, Node.js, ESM, and CommonJS usage.
Designed as a lightweight runtime dependency-free package for JavaScript projects.
Release
The site now reflects the package currently published on npm, including the expanded personal-information policy surface.
Latest
The website installs the current public package and links directly to the npm and GitHub sources.
Policy
Use array-form inputs or named fields for name, birthYear, email, username, phoneNumber, and location.
Phone
Bangladesh 880/local 0 phone matching works by default, with phoneCountryCodeAliases for other country codes.
Installation
Install passguardjs v0.3.1, import the analyzer, and wire the typed result into your form UI or validation flow.
npm install passguardjsimport { analyzePassword } from "passguardjs";
const result = analyzePassword("Swarup@01712345678", {
minLength: 12,
minScore: 70,
requireUppercase: true,
requireLowercase: true,
requireNumber: true,
requireSpecialChar: true,
blockUserInputs: true,
blockSequentialCharacters: true,
personalInfo: {
name: "Swarup Saha",
email: "swarup@example.com",
username: "swarup",
phoneNumber: "+8801712345678",
location: ["Dhaka", "Bangladesh"],
},
});
console.log(result);Live Demo
Strength score
0/100
Result
Very Weak
Status: Needs attention
All checks run locally in your browser.
Documentation Preview
Start with the core API, configure a policy, read the result object, and adapt the examples to your stack.
Core API
Use analyzePassword(password, policy?) for scoring, definePasswordPolicy for reusable configs, and strengthFromScore for labels.
Configuration
Set length limits, minScore, required classes, common/user-input blocking, phone aliases, banned substrings, and custom rules.
Typed output
Read score, strength, isValid, issues, suggestions, and detailed per-rule checks with optional metadata.
Frameworks
Integrate with Vanilla JS, React, Vue, Angular, Node.js, ESM imports, or CommonJS require using the same API.
Why PassGuardJS?
A regex can confirm that a password contains a number, symbol, or uppercase character. It cannot explain whether that password is common, repetitive, keyboard-like, personal, or simply too predictable for the policy you are trying to enforce.
PassGuardJS is built for meaningful analysis and developer-friendly feedback: return a score, list the issues, suggest safer choices, and keep the checks close to the product experience where users can act on them.