Free Online Recovery Code Generator
Create one-time recovery codes for two-factor authentication, self-hosted apps and personal backups. Pick an easy-to-read format, see the exact entropy and guess odds, then copy, download or print your set.
100% client-side · Web Crypto randomness · Nothing you generate is stored or sent
Odds assume all of your unused codes are valid. Time assumes 1,000 guesses per second with no lockout, which is far faster than a well-built service allows. Hyphens from grouping are not counted in the length or the entropy.
Codes exist only on this page. Save, download or print them before you close it.
How Recovery Codes Work
A recovery code is a random secret that you keep on paper or in a vault and use once if your normal sign-in method is lost. This page builds each code from your browser’s cryptographic random number generator, using rejection sampling so every character is equally likely, and makes sure no code appears twice in a set.
Strength is measured in bits of entropy: length multiplied by log2 of the alphabet size. The odds panel adds the recovery view. With N valid codes, one random guess hits one of them with chance N divided by 2 to the power of the bits, and an attacker needs about 2 to the power of the bits divided by N + 1 guesses on average. Each extra bit doubles the work.
- Keep at least two copies in different places, such as a password manager and a printed sheet in a safe.
- Do not keep the only copy inside the account the codes protect.
- Each code works once. Cross it off when used, and replace the set when most are gone.
- Delete downloaded files once the codes are stored safely.
Web Crypto Randomness
Every character comes from crypto.getRandomValues with unbiased selection, never Math.random
Entropy and Guess Odds
Bits per code, the chance one guess hits any of your codes, and the average time to find one
Readable Alphabets
Crockford Base32 and Base58 leave out look-alike characters, so paper copies are easy to type
Developer Hashes
Optional SHA-256 of each code, so a service can store the hash instead of the code
Unique Codes, Replace Any
A set never repeats a code, and any single code can be replaced without redoing the rest
Nothing Stored
Print from this page with no pop-up, no outside scripts and no network requests
Explore more free tools in our security tools collection, including our strong random password generator.
Frequently Asked Questions
1. What are recovery codes used for?
Recovery codes are one-time backup codes for getting into an account when your normal sign-in method is unavailable, for example when you lose the phone that holds your authenticator app or your security key. Each code works once, so they act as a spare key kept for emergencies.
2. How secure is this recovery code generator?
Every character comes from your browser’s cryptographically secure random number generator (crypto.getRandomValues), picked with rejection sampling so every allowed character is equally likely. The page loads no outside scripts, its content security policy blocks outgoing network requests, and nothing is saved, so the codes exist only on your device until you close the page.
3. How long should a recovery code be?
Strength is measured in bits of entropy, which the page shows under the generator. The default of 16 Crockford Base32 characters carries 80 bits. Shorter formats such as 10 hex characters (40 bits) or 8 digits (about 27 bits) are only reasonable because services limit guesses and accept each code once. Aim for 64 bits or more when you can choose.
4. Which code format should I choose?
Crockford Base32 is the recommended default: it leaves out I, L, O and U, so codes are easy to read from paper and type. Base58 is more compact but case-sensitive. Hexadecimal and digits-only match formats some systems expect, but need more characters for the same strength. Letters and numbers, or letters, numbers and symbols, are available when a system requires them, though look-alike characters and symbols make typing mistakes more likely.
5. How many recovery codes should I generate?
Eight to ten is typical. The odds figure under the generator shows the chance that one random guess matches any of your codes, and at 64 bits or more even a full set of 50 keeps that chance negligible, so the number is mostly about convenience. Replace the whole set once you have used several.
6. Can I use these codes with any online service?
Usually not. Most services create their own recovery codes and accept only those, so use the codes the service gives you. This tool is for software you build or host, for personal backup secrets such as the key to an encrypted archive, and for systems that let you supply your own code.
7. Where should I store my recovery codes?
Keep at least two copies in different places: an entry in a password manager (ideally not protected only by the account the codes unlock), a printed sheet in a safe or other locked place, or an encrypted file or drive. Avoid unencrypted notes, email and screenshot folders, and do not keep the only copy inside the account they protect.
8. How often should I replace my recovery codes?
Replace them after you have used one, if you think anyone may have seen them, when you change your main sign-in method, and now and then as routine housekeeping. On most services creating a new set cancels the old one, so check that before you discard the old copies.
9. I run a service. How should I store and check recovery codes?
Show each code to the user once, store only a hash, and accept each code a single time. Because these codes are random with 64 or more bits, a fast hash such as SHA-256 is adequate. Normalize what the user types (remove hyphens and spaces, fix the case for Base32), compare in constant time, rate-limit attempts, cancel the whole set when a new one is issued, and tell the user when a code is used. The optional SHA-256 column on this page hashes each code without hyphens, exactly as stored.
10. Is my data sent or stored anywhere?
No. Codes are created on your device, the content security policy blocks outgoing network requests, no outside scripts are loaded, and none of what you create is saved in cookies or local storage (the page only remembers your chosen site language). Printing uses this page rather than a pop-up window, and the print sheet is removed afterwards. Closing or reloading the tab discards the codes, so save what you need first.