🔐 2FA Code Generator

Turn a 2FA secret key into a live TOTP code — right in your browser. Works with Google Authenticator, Authy & Microsoft Authenticator.

Free · No sign-up

How to use the 2FA Code Generator

  1. 1. Paste your 2FA secret key — the Base32 text code shown when you set up two-factor login — into the box. Spaces and lowercase letters are fine.
  2. 2. If you copied a full otpauth:// link instead, paste it straight into the box or click 📋 Paste; the tool pulls out the secret, shows the issuer and account, and applies the link’s digits, period and algorithm automatically.
  3. 3. Check the settings: most sites use 6 digits, a 30-second period and SHA-1. Change Digits, Period or Algorithm only if the service says so.
  4. 4. Read the current code and its countdown bar, click Copy code, and enter it before time runs out; the next code is shown underneath.

Frequently asked questions

Is the 2FA code generator free to use?

Yes, it’s free with no account, and you can generate as many codes as you need. It follows the standard TOTP method (RFC 6238), so it works with secrets from services that support authenticator apps, such as Google, Microsoft, GitHub and Amazon.

Is it safe to paste my 2FA secret key into this website?

Here the codes are calculated in your browser with the Web Crypto API; the secret isn’t sent to GrabCast or saved — close the tab and it’s gone. Still, a 2FA secret is as sensitive as a password, so only use this on a device you trust and keep a real authenticator app as your main method.

How do I get a 2FA code from a secret key without my phone?

When you turn on two-factor authentication, most sites show a QR code plus a “can’t scan it?” option that reveals a text key. Paste that key here to get the same 6-digit codes an authenticator app would show. Store the key somewhere safe so you can recover access later.

Why is my 2FA code rejected when I log in?

TOTP codes depend on your device’s clock, so turn on automatic date and time if codes are refused. Also check the secret for typos and make sure Digits, Period and Algorithm match what the service specifies. Enter the code before the countdown bar runs out.

Can I use this 2FA generator instead of Google Authenticator?

For the same secret it produces the same codes as Google Authenticator, Authy or Microsoft Authenticator, so it’s handy as a backup or when your phone isn’t available. It doesn’t store your accounts, though, so you’ll need to paste the secret each time you visit.

Which 2FA secret formats and code settings are supported?

Base32 secrets (spaces and lowercase are fine) and full otpauth://totp/ links — paste the link straight into the box or use the Paste button, and the secret, issuer, account name, digits, period and algorithm are read from it. Codes can be 6, 7 or 8 digits, with a 30- or 60-second period (or the link’s own period) and SHA-1, SHA-256 or SHA-512. It generates time-based (TOTP) codes only — not counter-based HOTP codes or SMS codes.

🔒 Browse all privacy & security guides and tools →