TOTP Generator
TOTP Generator
Generate a 6-digit time-based one-time password from your Base32 secret key, using the RFC 6238 standard with SHA-1 and a 30-second step.
Use the Base32 secret shown by the service when you set up two-factor authentication. Letters A to Z and digits 2 to 7 only.
Algorithm: HMAC-SHA-1, 6 digits, 30-second step (RFC 6238)
About the TOTP Generator
The TOTP Generator creates a 6-digit time-based one-time password from a Base32 secret key. It follows RFC 6238: the current time is divided into 30-second steps, and each step is combined with the secret using HMAC-SHA-1 to produce a code. The code changes every 30 seconds.
This is the same method behind authenticator apps. The service that issued the secret checks the same time step, so it can confirm the code without the code itself ever being sent to the service in advance. A code captured by someone else stops working quickly, which is what makes it useful as a second factor.
The tool is made for testing and checking a two-factor setup, for example while you build a login flow or check that a backed-up secret still works. For day-to-day logins, use your authenticator app, and never paste a live account secret on a shared or untrusted computer.
How to use
- Replace the example secret in the Secret key (Base32) box with your own secret. The box comes filled with an example, so do not use that value for a real account.
- Click Generate code. The current 6-digit code appears, with a bar showing how many seconds remain.
- Enter the code where it is asked for before the bar runs out. The code refreshes automatically when the 30 seconds end.
- Use Copy code if you need to paste the code elsewhere, or Clear secret to empty the box.
Key features
- 6-digit TOTP codes per RFC 6238.
- HMAC-SHA-1 through the browser WebCrypto API.
- 30-second countdown bar with remaining seconds shown.
- Code refreshes automatically at the end of each 30-second step.
- Base32 validation with a clear error for invalid secrets.
- Codes computed locally, so the secret never leaves your browser.
Common uses
- Test a two-factor login flow while building it, without reaching for your phone.
- Check that a backed-up secret still produces the right code after moving to a new device.
- Compare the code with your authenticator app when a login fails, to find out whether the secret or the clock is wrong.
- Generate test codes while building something that accepts TOTP codes.
Frequently asked questions
It is the key a service gives you when you set up two-factor authentication. It uses only the letters A to Z and the digits 2 to 7, and it is usually shown as a QR code or as text you can copy.
TOTP codes are based on the current time in 30-second steps. When a step ends, the next code is different, so a code captured by someone else stops working quickly.
First check your device clock, because codes depend on the time being right. Then check the secret is complete and that the service uses 6-digit codes with HMAC-SHA-1 and a 30-second step, which is what this tool produces.
No. Paste the Base32 secret itself, not the otpauth link. The secret is the text shown next to the QR code when you set up two-factor authentication.
No. The code is calculated in your browser with WebCrypto, and the secret is never uploaded, stored or sent to a server. Even so, avoid entering a live account secret on a shared computer.
Yes, if both use the same secret and the same time step. The codes follow the RFC 6238 standard, so a code from this tool matches the one your app shows for the same secret.
The secret box comes filled with an example value so you can see how the tool works. Replace it with your own secret before you generate a real code, and never use the example value for a real account.
Paste your Base32 secret into the secret box, then click Generate code. The current 6-digit code appears with a countdown bar, and you enter that code where the service asks for it before the bar runs out.
It shows how many seconds are left in the current 30-second step. When the bar runs out the code changes, so enter the code while there is still time left on the bar.
Check that the secret is complete and uses only the letters A to Z and the digits 2 to 7, which are the only characters in Base32. Spaces, lowercase letters typed by hand, or a missing character will make the tool show an error.
No, this tool is made for testing and checking a two-factor setup, for example while you build a login flow or check that a backed-up secret still works. For day-to-day logins, use your authenticator app.
