简体中文

2FA guide

Why Is My 2FA Code Invalid?

When a site keeps rejecting your authenticator code, the algorithm is almost never the problem. It is usually the clock, the secret, or the timing. Work through these checks in order.

1. Your device clock is off

TOTP codes depend on the current time. If your computer or phone is more than about 30 seconds off, it calculates the code for the wrong time step and the server rejects it.

Turn on automatic date and time (Windows: Settings → Time & language → Set time automatically; macOS: System Settings → General → Date & Time; Android and iOS: Date & time → Automatic). The time zone does not matter, but the actual time does.

2. The code expired while you typed

If you enter a code in the last couple of seconds, it may expire before the server receives it. Wait for the countdown to restart and use a fresh code.

3. The secret is incomplete or mistyped

Base32 secrets only use the letters A–Z and digits 2–7. A missing character, a 0 instead of O, or a 1 instead of I produces a valid-looking but wrong code. Copy the key again rather than retyping it, or upload the original QR code instead.

4. You are using the key for a different account

If you have several accounts on the same service, each has its own secret. Check the account name shown under the issuer before copying the code.

5. 2FA was reset on the account

Every time 2FA is disabled and enabled again, the service creates a new secret and the old one stops working. If you re-enrolled recently, you need the new QR code.

6. Non-standard settings

Some services use 8 digits, SHA-256 or a 60-second period. A plain Base32 key assumes 6 digits, SHA-1 and 30 seconds. If the service provided an otpauth:// link, paste the whole link so the correct settings are applied.

Frequently asked questions

The code works on my phone but not in the browser. Why?

Almost always the computer clock. Turn on automatic time sync and reload the page.

I lost the secret. Can I get it back?

Not from a generator. Use the backup codes the service gave you or contact its support to reset 2FA.

Related guides