2FA Code Generator
Turn a Base32 authenticator secret into the current TOTP one-time code, with a live countdown. Everything runs locally in your browser with the Web Crypto API — your secret never leaves your device and nothing is stored. For testing and your own accounts.
The code refreshes automatically when the period rolls over.
How to use the 2FA code generator
- Paste the Base32 secret your service showed when enabling 2FA (the text behind the QR code), or paste a full
otpauth://link to fill every field at once. - Leave 6 digits, 30 seconds and SHA-1 selected unless the service asked for something else.
- Read the current code, watch the countdown, and click Copy before it refreshes.
The code is computed with RFC 6238 TOTP using your browser's native Web Crypto — there are no external calls, no libraries and nothing is saved. Keep your device clock accurate, since TOTP depends on the current time.
More PAYATE tools
Frequently asked questions
What is a TOTP authenticator code?
A TOTP (Time-based One-Time Password) is the six- or eight-digit code shown by authenticator apps like Google Authenticator or Authy. It is derived from a shared secret key and the current time, following RFC 6238, and changes every 30 seconds by default.
What is the secret key I need to enter?
It is the Base32 string a service gives you when you set up 2FA — the text behind the QR code, made up of the letters A–Z and digits 2–7, for example JBSWY3DPEHPK3PXP. Spaces are ignored, so you can paste it exactly as shown.
Is my secret sent anywhere or stored?
No. The code is computed entirely in your browser with the built-in Web Crypto API. Your secret is never uploaded to a server, never logged and nothing is stored — reload the page and it is gone.
Can I paste an otpauth:// link?
Yes. If you paste a full otpauth://totp/... URI, the tool reads the secret, digits, period and algorithm from it and fills the fields for you automatically.
Which digits, period and algorithm should I pick?
Most services use 6 digits, a 30-second period and SHA-1, which are the defaults here. Change them only if the service you are configuring specifies 8 digits, a different interval, or SHA-256 / SHA-512.
Why does the generated code not match my app?
The most common cause is a clock that is out of sync — TOTP depends on the current time, so make sure your device clock is accurate. Also confirm the secret, digit count, period and algorithm all match what the service issued.