Search tools

Search for a command to run...

2FA / TOTP Code Generator

Generate time-based one-time passwords (TOTP) from a Base32 secret — to test two-factor authentication setups, with SHA-1/256/512, 6–8 digits and custom periods.

How to use

  1. 1Paste the Base32 secret (the text under a 2FA QR code).
  2. 2The current code appears with the seconds left in this period. Press Calculate again for the next code.

How it's calculated

TOTP (RFC 6238) = HOTP(secret, floor(unix time ÷ 30)): an HMAC-SHA-1 of the time step, dynamically truncated to 6 digits. Everything runs in your browser.

Frequently asked questions

Is it safe to paste my real 2FA secret?

The code is computed entirely in your browser and nothing is sent anywhere, but treat 2FA secrets like passwords — use this for testing, not as your everyday authenticator.

Why doesn't my code match my app?

Check your device clock is correct, and that the digits, period and algorithm match the service's settings (almost always 6 digits, 30 s, SHA-1).

What is the Base32 secret?

When you set up 2FA, the QR code contains a secret like JBSWY3DPEHPK3PXP. Most sites also show it as text for manual entry.