Recovery and Invite Code Generator

Make batches of codes people can type without mistakes, strong enough for account recovery, with a check character that catches typos before a lookup.

Draait in je browser. Je bestanden verlaten je apparaat nooit. Zie hoe je dit controleert

…

Zo doe je het

  1. 1
    Choose the alphabet

    Crockford Base32 is a good default.

  2. 2
    Set the length

    Watch the entropy figure.

  3. 3
    Choose grouping

    Group size and separator.

  4. 4
    Add a check character

    Optional typo detection.

  5. 5
    Generate

    Up to 10,000 codes.

  6. 6
    Download with hashes

    Store only the hashes.

Over deze tool

Recovery codes let people back into an account when they lose their phone or security key, and invite, voucher and activation codes control who can join a service. Both need to be random enough that nobody can guess one, and easy enough that people can copy them from paper without mistakes. This generator uses the browser's cryptographic random number generator with rejection sampling, so every symbol is equally likely, and offers alphabets that avoid confusable characters: Crockford Base32 without I, L, O and U, an unambiguous set without 0, O, 1, I and L, digits only, hex or mixed case. Codes can be split into groups with a separator, given a prefix, and finished with a Luhn mod N check character that catches any single mistyped symbol and most swapped neighbours. The tool shows the entropy of each code and the chance that any two codes in the batch collide, can verify a typed code, and can export SHA-256 hashes so your database never stores the codes themselves.

How strong is strong enough

- Account recovery codes: NIST SP 800-63B asks for at least 64 bits for look-up secrets; 80 bits or more is a comfortable target, for example 16 Crockford characters. - Invite and voucher codes: 40 to 60 bits is usually enough when redemption is rate-limited. - One-time codes sent by SMS or email are a different kind of secret: short, but valid for minutes only.

Readable alphabets

Crockford Base32 also lets the checker accept I and L as 1 and O as 0, so common misreadings still work. Upper-case codes in a monospace font are easiest to read aloud and to type on phones.

Check characters

A Luhn mod N check character works over any alphabet. It detects every single-character error and most transpositions of adjacent characters, so your form can say there is a typo before it queries the database. It does not add security; the random part provides that.

Storing codes safely

Treat recovery codes like passwords. Store a hash rather than the code, compare hashes when a code is entered, mark each code as used after one success, and show the user how many remain. Show codes only once, offer a download and printing, and let people regenerate the set.

Printing

Print codes in a monospace font with clear spacing, and tell people to keep them somewhere safe and separate from their phone.

Limits

The generator runs in your browser and nothing is stored; if you lose the page, generate a new batch. Bulk sets of up to 10,000 codes are supported.

Uitgewerkt voorbeeld

Ten codes of 10 Crockford Base32 characters plus a check character, grouped by five, look like QM92X-5GM4E-K. Each carries 50 bits of entropy, and the chance of any duplicate in the batch is below one in a trillion.

In het kort

Veelgestelde vragen

How long should recovery codes be?

At least 64 bits of entropy; 16 Crockford characters give 80 bits.

Why avoid 0, O, 1 and I?

They are easily confused when read or typed.

What does the check character do?

It catches typing mistakes before the code is looked up.

Should I store codes in plain text?

No. Store hashes and mark each code used after one redemption.

Are the codes truly random?

Yes. They use the Web Crypto random generator without modulo bias.

Are codes sent or saved anywhere?

No. They exist only in this page until you download them.

Helemaal gratisGeen kosten, geen registratie
Bestanden blijven privéAlles draait in je browser
Makkelijk in je eigen taalBeschikbaar in veel talen