A fast, offline, dependency-free passphrase generator inspired by Bitwarden's — with the options Bitwarden is missing: fewer than 3 words, a maximum-length cap, configurable number placement, and fixed prefix/suffix text.
It's a single HTML file. No build step, no install, no tracking, no network calls at runtime. Open it in any browser, or host it on GitHub Pages.
Live demo: https://Claire.github.io/passphrase-generator/ (update after you enable Pages)
| EFF large wordlist | The same 7,776-word list Bitwarden uses, for ~12.9 bits of entropy per word. |
| 1–20 words | Bitwarden's floor is 3; this goes down to 1 for short, low-stakes phrases. |
| Custom separator | Any character(s), with quick-pick chips (dash, underscore, dot, space, none). |
| Capitalize | Uppercase the first letter of each word. |
| Number placement | Add a random digit at the end/start of a random word, the start/end of the passphrase, or the end of every word. |
| Fixed prefix & suffix | Optional literal text added verbatim at the very start/end (e.g. to satisfy a site's rules). |
| Maximum length cap | Words are chosen to fit a character budget — the result never exceeds your limit. |
| Live strength meter | Shows entropy in bits and a Weak → Excellent rating that updates as you tweak. |
| Light / dark theme | Follows your OS by default, remembers an explicit choice, applies before first paint (no flash). |
| Local persistence | Settings and history are saved on your device (when run as a saved file or hosted). |
| History | The last 20 generated passphrases, one click to copy, with a clear button. |
| Secure randomness | Uses crypto.getRandomValues with unbiased rejection sampling — never Math.random. |
| Accessible | Full keyboard navigation, visible focus, ARIA live announcements, a progressbar strength meter, reduced-motion support, and WCAG AA contrast. |
Every choice — which word, which digit, which word gets the digit — comes from window.crypto.getRandomValues, the browser's cryptographically secure RNG. A small rejection-sampling helper removes modulo bias so each word in the list is exactly equally likely. Math.random is never used.
Strength is reported as entropy in bits, assuming an attacker knows exactly how the passphrase was built (the standard, paranoid assumption). Only genuinely random choices count:
- Each random word:
log₂(7776) ≈ 12.9 bits - Random-word digit:
log₂(10)for the value +log₂(words)for which word - Fixed-position digit (phrase start/end):
log₂(10) - "Every word" digit:
log₂(10)per word - Capitalize / prefix / suffix / separator:
0 bits— they're predictable, so they add length but not strength
Ratings: Weak < 40 · Fair 40–59 · Good 60–79 · Strong 80–109 · Excellent 110+. For reference, anything Strong (80+ bits) is already far beyond brute-forcing in any human timescale.
Instead of generating-and-praying, the generator reserves space for the fixed parts first — separators, the optional digit(s), and any prefix/suffix — then fills the remaining character budget with words drawn only from the pool short enough to still leave room for the rest. The total always lands at or under your cap. If you ask for the impossible (e.g. 5 words in 12 characters), it shows the best short version and tells you why, rather than silently overflowing or truncating text you typed.
There is no server and no analytics. Settings and history live in your browser's localStorage, only on your device. Persisted data is treated as untrusted on load and clamped to valid ranges, so a corrupted or edited store can't break generation. (Note: browser storage requires a file:// or https:// origin — it won't persist inside sandboxed previews, only when you open the saved file or visit the hosted page.)
The whole app — markup, styles, the 7,776-word list, and logic — is a single .html document using vanilla JavaScript. No framework, no bundler, no build. That's what makes it trivial to audit, fork, and host.
Locally: download index.html and double-click it. It works fully offline. (Web fonts load from Google Fonts when you're online and gracefully fall back to system fonts when you're not.)
Hosted (GitHub Pages): see the publishing steps below — the result is a shareable URL.
- Vanilla HTML/CSS/JavaScript (ES2020+). No dependencies, no build tooling.
- Theming via CSS custom properties; light/dark by swapping a single
data-themeattribute. - Accessibility: semantic controls,
:focus-visiblerings, anaria-livestatus region, arole="progressbar"strength meter, and aprefers-reduced-motionguard.
- Wordlist: the EFF large wordlist (7,776 words) by the Electronic Frontier Foundation, released under CC BY 3.0 US. Thank you, EFF.
- Inspired by the passphrase generator in Bitwarden.
Code is released under the MIT License. The EFF wordlist retains its own CC BY 3.0 US license; attribution to the EFF (above and in the file header) satisfies it — please keep that credit if you fork.
