zxcvbn

A realistic password strength estimator that models how attackers actually guess passwords, not arbitrary composition rules.

Library
npm
v4.4.2
16,048stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
48/100Fair
Development Activity0
Maintenance20
Community72
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
69/100Good
Architecture70
Code Quality60
Innovation80
Learning Curve65

zxcvbn is a client- and server-side JavaScript library for estimating password strength by pattern-matching against real-world attacker knowledge rather than blunt composition rules. Instead of scoring passwords by counting character classes, it recognizes tens of thousands of common passwords, common first and last names drawn from US census data, popular English words from Wikipedia and US television and film, and structural patterns like dates, repeats (aaa), sequences (abcd), keyboard walks (qwertyuiop), and l33t-speak substitutions.

For each pattern it finds, zxcvbn estimates the number of guesses an attacker would need and combines overlapping matches into the single most efficient (lowest-guess) explanation of the password using a dynamic-programming search. The result reports an integer score from 0-4, order-of-magnitude guess counts, back-of-the-envelope crack-time estimates under several attack scenarios (throttled online, unthrottled online, slow offline hashing, fast offline hashing), and targeted verbal feedback developers can surface directly in a signup form.

What You Get

  • A single zxcvbn(password, user_inputs) function returning a score (0-4), guess estimates, and crack-time estimates for four attack scenarios
  • Pattern-matching dictionaries for common passwords, English words, US census names, and pop-culture terms (TV/film)
  • Keyboard-adjacency graphs (qwerty, dvorak, keypad, mac keypad) for detecting spatial patterns like walks and turns
  • Targeted, human-readable feedback (warning + suggestions) for scores of 2 and below, ready to show directly in a UI
  • A prebuilt, minified dist/zxcvbn.js bundle for direct <script> inclusion alongside the npm/CommonJS/AMD module forms

Common Use Cases

  • Signup and password-reset forms - replace rigid composition rules (‘one uppercase, one number, one symbol’) with a live strength meter that rejects genuinely weak passwords and allows strong passphrases
  • Enterprise password policy enforcement - gate account creation on a minimum zxcvbn score instead of guessable regex-based rules that both admit weak passwords and reject strong ones
  • Personal-info-aware strength checks - pass a user’s name, email, or company name as user_inputs so passwords built from personal information score appropriately low
  • Security research and password auditing - batch-score existing password dumps or policy proposals to estimate real-world crackability

Under The Hood

Architecture main.coffee orchestrates a linear, functional pipeline: matching.omnimatch(password) generates candidate pattern matches (dictionary, spatial, repeat, sequence, date, regex, l33t) each tagged with start/end indices and pattern type; scoring.most_guessable_match_sequence performs a dynamic-programming search over overlapping matches, partitioned by end index, to find the minimal-guess non-overlapping sequence; time_estimates.estimate_attack_times converts total guesses into crack-time buckets; feedback.get_feedback derives warning/suggestion strings from the winning sequence. The four modules communicate only through plain data, and the one piece of mutable state (the user-input dictionary) is explicitly reset per call, keeping the library stateless from a caller’s perspective — but there is no abstraction boundary between match generation and guess estimation, so changing the core scoring formula in scoring.coffee would ripple through every consumer of scores and crack times.

Tech Stack Written entirely in CoffeeScript, compiled via coffee -o lib to CommonJS for Node/npm and bundled with Browserify plus coffeeify and uglifyify into a standalone UMD dist/zxcvbn.js for direct <script> tags, AMD (RequireJS), and Bower consumption. A small Python data-scripts/ directory regenerates the frequency-list dictionaries (Wikipedia, US census names, US TV/film corpus) offline and plays no part in the runtime path. There are no runtime dependencies; devDependencies cover only the CoffeeScript build chain and the test chain. The deployment target is simply the published npm package, Bower component, or CDN-hosted dist bundle — there is no server or database involved anywhere in the library.

Code Quality Tests live in test/test-matching.coffee and test/test-scoring.coffee using the tape framework via coffeetape, with parametrized table-driven assertions covering core numeric helpers and match/scoring correctness; CI runs on Travis and cross-browser SauceLabs testing via zuul specifically for the browser environment. There is no type system — CoffeeScript is untyped — and no linter or formatter is configured. Error handling is minimal by design: the library operates on plain strings and returns a result object rather than throwing, which is appropriate for a synchronous, I/O-free scoring function. Naming is consistent snake_case throughout, matching CoffeeScript community convention.

API Design The entire public surface is a single function, zxcvbn(password, user_inputs = []), returning one plain object with score, guesses, crack time estimates, sequence, and feedback — essentially zero boilerplate to get a usable password-strength meter running. The user_inputs parameter is a notably good ergonomic touch, letting callers cheaply fold personal-info-aware scoring into the same call rather than requiring a separate pass. The tradeoff is bundle size, dominated by dictionary data, which the README documents candidly alongside several lazy-loading strategies for mitigating page-load latency.

Used by 14 apps in this directory

Go
86%
Apache 2.0

Authelia

Security · Authentication

28,815

OpenID Certified SSO and MFA portal for securing self-hosted web applications behind reverse proxies.

View details
91
Repo Health
81
Technical
76
Dependency
Built with
Go86%
TypeScript12%
Updated today
Go
54%
Apache 2.0

Authgear

Authentication

2,028

Open-source, self-hostable authentication platform with passkeys, biometric login, SSO, MFA, and GraphQL admin API — a full Auth0/Clerk/Firebase alternative for SaaS and mobile apps.

View details
88
Repo Health
81
Technical
68
Dependency
Built with
Go54%
HTML25%
TypeScript18%
Updated 3 days ago
Vue
54%
GPL 3.0

Financial Freedom

Invoicing Finance

2,923

Own your financial data with a self-hosted, privacy-first budgeting app that replaces Mint and YNAB.

View details
48
Repo Health
67
Technical
74
Dependency
Built with
Vue54%
PHP44%
Updated 4 months ago
TypeScript
74%
Apache 2.0

Jitsi Meet

Team Chat · Collaboration · Video Conferencing

29,879

Open-source, end-to-end encrypted video conferencing you can self-host or embed into any web or mobile app.

View details
96
Repo Health
85
Technical
69
Dependency
Built with
TypeScript74%
JavaScript10%
Updated yesterday
TypeScript
76%
Other

Joplin

Note Taking

56,257

The privacy-first, open-source note-taking app with end-to-end encrypted sync, AI assistance, and a powerful plugin ecosystem across every platform.

View details
93
Repo Health
87
Technical
61
Dependency
Built with
TypeScript76%
JavaScript14%
Updated yesterday
Scala
62%
AGPL 3.0

lila (Lichess)

Community

18,710

The forever-free, ad-free, open-source chess server powering millions of real-time games, AI analysis, puzzles, and tournaments worldwide.

View details
89
Repo Health
80
Technical
75
Dependency
Built with
Scala62%
TypeScript27%
Updated yesterday
JavaScript
87%
GPL 3.0

NodeBB

Community

15,217

Modern Node.js forum software with real-time WebSockets, multi-database support, and a plugin ecosystem — the community platform built for the open web and the Fediverse.

View details
97
Repo Health
78
Technical
70
Dependency
Built with
JavaScript87%
Go Template12%
Updated today
TypeScript
53%
Other

Phase Console

Security · Devops

914

End-to-end encrypted secrets management for engineering teams — from local dev to Kubernetes production.

View details
83
Repo Health
73
Technical
66
Dependency
Built with
TypeScript53%
Python45%
Updated 2 days ago
Python
54%
Other

PostHog

Analytics · Monitoring · Developer Tools

39,612

The all-in-one open source product platform combining analytics, session replay, feature flags, error tracking, AI observability, and a built-in data warehouse in a single self-hostable stack.

View details
92
Repo Health
80
Technical
65
Dependency
Built with
Python54%
TypeScript36%
Updated today

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search