b2KIT

2FA Backup Code Generator

Generate secure backup/recovery codes for two-factor authentication with configurable format and quantity.

Tested tool guide Tested browser tools Checked August 16, 2026

What 2FA Backup Code Generator does and how it behaves

This tool prints a list of one-time recovery codes, the kind a two-factor login asks for when your authenticator app is lost, broken, or just reset. You choose the character set (digits, lowercase, uppercase, or mixed), the grouping and separator (for example XXXX-XXXX), and how many codes to produce. Each character is drawn independently at random, so one run gives you no information about the next. Everything happens in your browser and nothing is uploaded. The thing users get wrong: generating codes here does not register them with any account. They only work with a service that accepts user-supplied codes, or as a practice set.

How the result is produced

1

Randomness and strength

Every character position is chosen uniformly from the set you selected. A six-digit numeric code has exactly 1,000,000 possibilities, while ten mixed alphanumeric characters give 62^10, roughly 8.4 x 10^17. Codes are drawn independently, so one leaked code reveals nothing about the rest; the strength of the set is set by your length and character-set choices, not by the tool.

2

Format and output

You set the quantity, the characters per group, the number of groups, and the separator (hyphen, space, or none). The result is a list you can copy as plain text into a password manager or print as a paper card. Every run yields a different set, so the only list that matters is the one you actually registered or stored; generate once and keep that copy.

Good uses

  • You administer a self-hosted or small team service that lets you register recovery codes for an account: generate a set here, enter it on the service side, and keep the identical list in your vault.
  • You are developing or testing a login flow and need disposable codes to prove the recovery path works end to end without touching a real account's codes.
  • Your existing backup codes are suspect (a device was lost or a list was shared): generate a fresh set, re-register it where the service allows, and destroy the old one.

Limits and checks

  • The codes are not enrolled anywhere by this tool. Most mainstream services (Google, Microsoft, GitHub) issue their own backup codes during enrollment and reject codes you generated yourself, so an unregistered list is decoration until a service actually accepts it.
  • Each code is single-use by design. Ten codes mean ten recovery sign-ins total; after one is typed, it should be dead everywhere, and some services revoke the entire set when you generate a replacement, stranding the old list.
  • The output is only as safe as where it lands. A clipboard that syncs across devices, a cloud-synced note, or a screenshot album exposes the exact keys that bypass your second factor, so store codes in an encrypted vault or on paper.

Common questions

Will these codes work for my Google, Microsoft, or GitHub account?

No. Those services generate their own backup codes when you enable two-factor authentication, store them hashed on their side, and accept only codes they issued. A list you generated elsewhere will not be recognized. Use this tool with services that accept user-registered codes, or for testing.

How many backup codes should I generate?

Treat each code as one recovery login, and generate enough to last until your next re-enrollment. Most services issue sets of 8 to 16 codes. A set of 12 to 20 leaves headroom for rare use over a couple of years; the only cost of more codes is storing a longer list safely.

References and verification

The behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools