Skip to content
Built in Lahore, PakistanHow we check the math
mathbehind

How Long Should a Password Be? Entropy, Length and Passphrases

Entropy measures how many guesses a random password takes, in bits. The math shows why length beats complexity, what current NIST guidance says, and how passphrases compare.

By Muhammad Ahmad, Software EngineerLinkedIn· figures checked

Published , updated . 4 min read.

Want to run your own numbers?Password Entropy CalculatorOpen the calculator

Password rules usually ask for complexity: an uppercase letter, a number, a symbol. The math of entropy shows that length matters much more, as long as the password is truly random. This guide explains the calculation, what length current guidance recommends, and when a passphrase of random words is the better choice.

What entropy measures

A random password of length L, drawn from N possible characters, has N^L possible values. Entropy is log₂ of that number, so it equals L × log₂ N bits. Each extra bit doubles the number of guesses an attacker needs.

12 random letters and digits, fast offline attack
  1. Bits per character

    log₂ 62equals5.95

  2. Entropy

    12 × 5.95equals71.5 bits

  3. Average time

    62¹² ÷ 2 ÷ 10,000,000,000/sequals5,112 years

Length vs complexity

Adding symbols grows the character set from 62 to 95, which raises entropy per character from 5.95 to 6.57 bits. Adding one more character to a letters-and-digits password adds a full 5.95 bits. So a 14-character password of letters and digits (83.4 bits) is stronger than a 12-character password with symbols (78.8 bits).

How long should a password be?

The US National Institute of Standards and Technology's digital identity guidelines (SP 800-63B) ask services to require at least 15 characters when a password is the only sign-in factor, and at least 8 when it is combined with another factor. They also advise against forced complexity rules and routine forced changes, and recommend allowing long passwords.

A random 16-character password of letters and digits
  1. Bits per character

    log₂ 62equals5.95

  2. Entropy

    16 × 5.95equals95.3 bits

  3. Average time

    62¹⁶ ÷ 2 ÷ 10,000,000,000/sequalsLonger than the age of the universe

A random 16-character password has over 95 bits of entropy, beyond any practical guessing attack. By contrast, an 8-character random password with symbols has about 52.6 bits, which a fast offline attack can exhaust in days.

Attack speed matters too

  • Online logins are rate-limited, so attackers get only a few guesses per second per account.
  • If a password database is stolen, attackers guess offline. Slow hashes such as bcrypt allow thousands of guesses a second; fast, unsalted hashes allow billions.

That is why the same password can be safe for decades against one attack and weak against another.

Passphrases vs random passwords

A passphrase is several random words strung together. For a password, each character is one random choice from the character set; for a passphrase, each word is one random choice from a word list.

  • A standard diceware list has 7,776 words, so each random word adds log₂ 7,776 ≈ 12.9 bits.
  • 4 words ≈ 51.7 bits, 5 words ≈ 64.6 bits, 6 words ≈ 77.5 bits, 7 words ≈ 90.5 bits.
  • 6 random words roughly match a 13-character random password of letters and digits.

The math only holds if the words are picked at random, by dice or a generator. A phrase from a song, a quote or a sentence you made up has far less entropy, because attackers try common phrases first.

The catch: humans aren't random

All of this assumes random characters or words. Passwords people invent follow patterns, such as dictionary words, names, dates and predictable substitutions, and attackers try those patterns first. A made-up password can have far less real entropy than its length suggests.

Practical defaults

  • Password manager: let it generate 16 to 20 random characters for every account.
  • Passwords you must type or remember: use a passphrase of 6 or more random words.
  • Always add a second factor where it's offered; it matters more than any length rule.

Worked comparisons

Assuming an attacker can make 10 billion guesses a second against a stolen, fast-hashed password database:

  • 12 random characters from all 95 printable characters: about 78.8 bits. Around 1.7 million years to try every combination.
  • 16 random letters and digits (62 characters): about 95.3 bits. Far beyond any practical attack.
  • 20 random lowercase letters: about 94 bits. Easy to type, and just as strong as the previous example because of its length.
  • 4 random words from a 7,776-word list: about 51.7 bits. Crackable in days at this speed if the hash is fast, so too weak for anything important.
  • 6 random words from the same list: about 77.5 bits. Roughly 680,000 years at this speed, comparable to a 12-character random password and much easier to remember.

The pattern is clear: length is the cheapest way to add strength. Adding two more words to a passphrase does far more than swapping letters for symbols.

What websites should do

If you build login systems, the attacker's guessing speed is partly in your hands. Storing passwords with a slow, salted hashing algorithm designed for passwords, such as bcrypt, scrypt or Argon2, cuts the guesses per second by many orders of magnitude compared with fast hashes. Checking new passwords against lists of known breached passwords stops the weakest choices, and offering multi-factor authentication protects even users who pick poorly.

Questions people ask

Is a 4-word passphrase strong enough?
For important accounts, no: 4 random words give about 51.7 bits. Six random words give about 77.5 bits, similar to a 12-character random password.
How many characters should a password have?
NIST SP 800-63B asks for at least 15 characters when a password is the only factor. For accounts in a password manager, 16 to 20 random characters is a sensible default.
Is a passphrase safer than a password?
It can be, if the words are chosen at random. Six random words from a 7,776-word list give about 77.5 bits, similar to a 13-character random password.
Do symbols make a password much stronger?
Less than length does. Symbols add about 0.6 bits per character, while one extra letter or digit adds about 5.95 bits.

Sources

  1. NIST SP 800-63B: Digital Identity Guidelines, Authentication