Free · runs in your browser

XKCD Style Password Generator

XKCD Style Password Generator. Set your word count and click Generate Password to build an XKCD-style password from plain, memorable words. For a master login that must be easy to type, the passphrase generator strings together random words with a separator, capitalization and an optional number.

Your values
Words

A bigger list adds more bits per word. The 2,048-word list matches the original xkcd comic.

Enter a number between 2 and 10. Four is the xkcd comic's choice; five or six suits a master password.

Shorter words are faster to type but shrink the word pool.

Must be at least the minimum length.

Transformations

Only the random option adds entropy (1 bit per word); the others are predictable patterns.

Separator

Enter exactly 1 character, e.g. - _ . , ; / ~ ! @ # $ %

Padding

Random digits added before the first word. Each adds about 3.32 bits.

Random digits added after the last word. Each adds about 3.32 bits.

Fixed adds a set number of symbols to each end; adaptive pads the end up to an exact length (a longer password is left as it is).

Output

Enter the number of passwords to generate.

Show passwords as

Result

Your xkcd-style password
—
All passwords (bulk text)
—
Length
—
Strength
—
Entropy (blind brute force)
—
Entropy (seen, with full knowledge of the settings)
—
Bits per word
—
Words in the pool after length filter
—
Number of possible passwords
—
  • No account, no logging
  • Open formulas explained below
  • Works offline once loaded

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.

Formula and waterfall chart showing six random words from a 7,776-word list adding 12.9 bits each to reach 77.5 bits of entropy
Six words from a 7,776-word list build up to 77.5 bits of passphrase entropy.
Counting bits of entropy in an xkcd-style password
WordsBits of entropy1,000 guesses/second10 billion guesses/second
338.87.4 years24 seconds
451.757,900 years2.1 days
564.6450 million years45 years
677.53.5 trillion years350,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.

Timeline of average brute force cracking time for passphrases of three to seven words, from 24 seconds to 2.7 billion years
Average cracking time at ten billion guesses per second for three to seven random words.

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.

Grid of bits of entropy for four to seven words drawn from word lists of 2,048, 4,096 and 7,776 words
Bits of entropy by number of words and word list size; the outlined cell is the six-word example.

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.

Choosing a vault master passphrase with an xkcd password generator
WordsBitsAverage time at 100 billion/second
451.75.1 hours
564.64.5 years
677.535,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.

About the author

Vinitha Pu

Founder and designer

Vinitha Pu is a graphic designer based in Palakkad, Kerala, who builds free, privacy-friendly browser tools. She studied Textile and Apparel Design at Avinashilingam University and completed a C-Tech in Graphic Design at Image Creative Education in 2025. She designs, builds and maintains the password generators, strength checkers, hash tools and security calculators on PasswordHive.

  • Content author: Vinitha Pu
  • Fact checked by: Vinitha Pu. Each tool's output is checked against official test vectors or a reference implementation, and every strength and crack-time figure against the formula it uses, before it goes live.
  • Published Updated