An XKCD style password generator strings together four random common words to build a phrase that is hard to guess yet easy to remember, exactly as the famous comic proposed. Rather than stacking symbols you will forget, you let length and randomness carry the load. Here is how the idea works, how to measure its strength, and how to generate your own safely.
Why a memorable passphrase beats complexity
The comic compared a mangled dictionary word such as "Tr0ub4dor&3" with the phrase correct horse battery staple. The first is painful to recall and surprisingly easy for software to guess, because the substitutions follow predictable habits. The second is a chain of four unrelated words, which your brain stores as a silly picture. For compliance with a policy that dictates length and character classes at each position, the pattern based password generator is a practical choice.
That contrast rests on information theory: what protects your passwords is the number of equally likely possibilities, not how strange the string looks.
Password strength without symbol tricks
Every added word multiplies the possibilities exponentially, while a swapped letter adds almost nothing. A single dictionary word falls in seconds, so password strength comes from length first and cleverness a distant second. Easy-to-remember phrases also mean fewer reused logins.
Counting bits of entropy in an xkcd-style password
Entropy measures how unpredictable a secret is, and the unit is the bit: each bit doubles the guesses an attacker needs. With a list of 7,776 entries, every word you draw randomly contributes about 12.9 bits, so the total is simply the word count times that figure. The table shows what that means at two attack speeds, using the average case of half the search space. Set the length and character set, then let the free bulk password generator fill a text document with random entries to copy or download.
| Words | Bits of entropy | 1,000 guesses/second | 10 billion guesses/second |
|---|---|---|---|
| 3 | 38.8 | 7.4 years | 24 seconds |
| 4 | 51.7 | 57,900 years | 2.1 days |
| 5 | 64.6 | 450 million years | 45 years |
| 6 | 77.5 | 3.5 trillion years | 350,000 years |
How word list size sets the entropy
A bigger word list means more bits per pick. The EFF long list holds 7,776 entries because it was built for diceware, where five dice rolls choose each word; any plain wordlist with one entry per line works, as long as it is stripped of duplicates and odd fragments. A tiny list weakens the result no matter how many words you add, so check the size before trusting a tool.
Brute force cracking time by guess rate
The speed column matters as much as the bits. A throttled website lets an attacker try perhaps a thousand guesses per second, but a stolen database protected by weak hashing can be attacked billions of times per second. If you assume the worse case, three words are not enough and five or six are the sensible choice for brute force resistance.
Generating passphrases step by step
Using this password generator takes under a minute, and everything runs in your browser. Your choices are the number of words, a separator, and capitalization. Each click gives a fresh phrase, so you can reject any you dislike without weakening the next draw, unlike reused passwords.
Pick the number of words
Start with five words for an everyday account and six for anything that guards money or a password vault. Longer phrases cost only a few extra seconds to type. If a site caps the length at 16 characters, choose shorter words rather than dropping a word.
Choose a delimiter and capitalization
A delimiter such as a hyphen makes the phrase easier to read and type. Some sites demand numbers or capitals, so capitalize each word or append one digit; this adds little entropy, so do not count it as a replacement for another word. Command-line tools even offer an acrostic mode that spells a chosen word with the first letters, though that constraint lowers randomness.
Choosing a vault master passphrase with an xkcd password generator
Imani Okafor is moving her family's logins into a new vault and needs a master passphrase she can type from memory. She can't write it down, so the decision is how many words she can live with. She sets the tool to the 7,776-word EFF list, a hyphen as separator, no capitals, and clicks generate several times. The fourth draw reads lumber-gravel-oxide-tamper-visa, five words, which works out to 5 × log2(7,776) = 64.6 bits of entropy.
Next she checks it against a realistic threat: a stolen vault file attacked offline at 100 billion guesses per second, a figure typical of a GPU cluster against a fast hash. Half of 7,7765 is about 1.42 × 1019 guesses, so the average search takes roughly 4.5 years. That matters because her vault uses a slow key-derivation function, which pushes the real figure far higher, but she prefers not to lean on that.
| Words | Bits | Average time at 100 billion/second |
|---|---|---|
| 4 | 51.7 | 5.1 hours |
| 5 | 64.6 | 4.5 years |
| 6 | 77.5 | 35,000 years |
The sensitivity rerun settles it. Dropping to four words collapses the time to about five hours, so that is out. Moving to six words costs her one extra word to memorize and buys a margin no hardware will close. The EFF recommends six diceware words for high-value secrets, and I agree: the number to watch is the word count, because each extra word multiplies the work by 7,776.
One caveat applies. If she had swapped "gravel" for a word she likes better, the 64.6 bits would no longer hold, since the draw stopped being random and an attacker guesses human favorites first. When she dislikes a phrase she regenerates the whole thing. She settles on six words, practices them for three days, and enters them in the vault.
Secure randomness behind every passphrase
An algorithm that picks words is only as good as its source of chance. If the pick is randomly distributed and the list is public, the bits in the table hold even when an attacker knows exactly how you built the phrase, which is the standard assumption in security design. Browser tools written in JavaScript need to be careful here.
Why cryptographically secure randomness matters
Many hobby tools call Math.random(), which is predictable once an attacker observes enough output. The browser's getRandomValues function draws from the operating system instead, which makes the draw cryptographically secure and the result safe to use for real logins.
A random number generator you can audit
Prefer a tool whose source code is public, because then anyone can confirm the random number generator and word list are what the page claims. A closed page that sends your phrase to a server fails that test, however pretty its interface.
Building your own XKCD style password generator
Writing a small xkcd-style password generator is a classic beginner project: load a wordlist, choose indexes with a secure source, and join the words. Several open projects show how, and the information they print can be a good sanity check for your own choices.
Command-line options in xkcdpass
The Python package xkcdpass accepts flags for the word count, minimum and maximum word length, delimiter, case, and a custom list. Setting the case to capitalize and the delimiter to a hyphen yields phrases that read cleanly, and a verbose switch reports the entropy of the list you picked.
Is correct horse battery staple still safe to use
Never use that exact phrase, since every cracking dictionary includes it by now. The method remains sound when the words are drawn randomly from a large list; critics are right that people-chosen words are weak, but machine-chosen ones are not. A tool that stresses common words also keeps phrases typeable on a phone, which means you are less likely to retreat to weaker habits. Many people keep their passwords in a KeePass vault and memorize only the master phrase, and that pairing offers the best balance of passphrases you can recall.
When to use a password manager instead
For the dozens of accounts you rarely visit, let a manager create and fill long random passwords. Keep memorable phrases for the few secrets where security depends on what you type yourself, such as the vault, your laptop login, and your email.
Frequently Asked Questions
- What's the actual idea behind the xkcd 936 method?
- The comic's core argument is that a long string of common words (like "correct horse battery staple") has far more entropy than a short, complex-looking password (like "Tr0ub4dor&3"), while being dramatically easier for a human to remember — length beats forced complexity, because entropy scales with the number of possible combinations, not how "random-looking" the result is.
- Why lowercase and no symbols by default?
- That matches the comic's original point -- the security comes from combining several words from a large wordlist, not from capitalization or special characters. You can still turn on a trailing number if a site requires one, but it's optional here rather than forced.
- Is 4 words from this wordlist actually strong?
- Yes -- each word from the EFF short wordlist contributes about 10.3 bits of entropy, so 4 words give roughly 41 bits, comparable to an 8-character fully-random password using upper/lower/numbers/symbols, but noticeably easier to memorize and type accurately.
- Should I add more words for extra security?
- Yes, if you want a stronger result -- each additional word adds about 10.3 more bits of entropy. Use the slider to try 5 or 6 words for passphrases protecting especially sensitive accounts, like a password manager's master password.
- Is the generated passphrase sent anywhere?
- No. Every word is chosen using the Web Crypto API's cryptographically secure random number generator, entirely inside your browser -- nothing is transmitted or stored.