Proxy Mail QA

How long should my registration form password be?

The short answer comes from NIST's digital identity guidelines. The longer answer is checking that your form and your server both do what you decided.

Updated

Our recommendation, up front. We make Proxy Mail QA, so we’re not neutral, but it doesn’t choose your password policy. The numbers below come from NIST’s digital identity guidelines (SP 800-63B, fourth revision), which many security teams follow. We recommend Proxy Mail QA for the step after you decide: checking that your form and your server actually do what you decided, with test passwords at exactly the minimum and maximum, one either side, and every kind of symbol. It doesn’t review your password storage or your security as a whole.

The short answer

The rest of the guidance, in plain words

NIST’s guidance for passwords chosen by users also says:

Why have a maximum at all?

A very long password costs your server time to hash, so a maximum stops someone sending megabytes as a password. Set it well above what people use: 64 is the least NIST recommends allowing, and 128 or 256 is common.

Watch your hashing algorithm. bcrypt reads only the first 72 bytes of a password and ignores the rest. Two long passwords that start the same then sign in as each other. A character can be more than one byte (é is two, an emoji is four), so 72 bytes can be fewer than 72 characters. Either:

Put the rules where the browser can see them

HTML
<label for="password">Password</label>
<p id="password-rules">At least 15 characters. Any letters, numbers, symbols or spaces.</p>
<input id="password" name="password" type="password" autocomplete="new-password" minlength="15" maxlength="128" aria-describedby="password-rules" required />

Check that your form does what you decided

get_password_variants (MCP), qa.passwordVariants() (npm) or GET /v1/variants/passwords (REST API) take your rules (min_length, max_length, and whether symbols are allowed) and return fresh test passwords in three groups:

Group With a 15-to-64 policy What should happen
accept Exactly 15 and exactly 64 characters; each kind of symbol; a space inside; éüñ Accepted, and signs in afterwards exactly as typed
reject 14 characters; 65 characters Refused, with the rule, before an account is made
decide Only digits; only lower-case letters; a space at the start or end; an emoji; é typed two ways; two passwords sharing their first 72 bytes (when the maximum is over 72) Your choice, but decide on purpose. Under NIST, a 15-digit password is allowed unless it’s on your blocklist

The 72-byte pair is the one to watch: if the second password signs in to the account made with the first, your app is cutting passwords short.

You can run these by hand, from an agent, or in a test:

Prompt
Our password policy is 15 to 128 characters, any characters allowed. Using Proxy Mail QA,
get_password_variants with min_length 15 and max_length 128, and try each one on
https://staging.acme.dev/signup with a new test address (use a plus tag for each).
For accepted ones, verify the account and sign in with the same password.
Give me a table: what it tests, accepted or refused, the message shown, and whether
signing in worked.

If refused passwords show no error at all, see Why is my registration form not showing password errors?

What Proxy Mail QA doesn’t do here

Sources: NIST SP 800-63B-4, and its section on authenticators.

Try it on your next sign-up test

Free plan, no credit card. Create an address and watch the code or link arrive.

Create a free accountOpen the app

Built your app with an AI tool? Pick yours