TOTP Secret
RFC 6238 TOTP is a shared Base32 secret plus a time step (usually 30 seconds). Authenticator apps turn that secret into a six-digit code. Generating the secret here is step one; the user must scan or type it into an app you control. SMS is not a substitute.
What the TOTP secret generator is for
TOTP is the six-digit code from an authenticator app. It works from a shared secret plus the current time, so it needs no network connection and cannot be phished as easily as an SMS code.
Adding it means a stolen password alone is no longer enough to take an account — the single most effective upgrade most systems can make.
Common uses
- Building two-factor authentication into an application
- Producing a test secret and QR code while developing enrolment
- Understanding the otpauth:// URI format
- Demonstrating how authenticator apps are provisioned
What the output means in the real world
The Base32 string is the raw shared secret. The otpauth:// URI is what a QR encoder should wrap for Google Authenticator, Aegis, or 1Password. Store the secret hashed or in a KMS on the server; show it once at enrolment. If this secret leaked, revoke that factor and enrol a new one. Never email the Base32 value.
How this fits into real work
NIST SP 800-63B treats TOTP as a single-factor unless the device is something you have and is protected. It is still far better than SMS, which SS7 and SIM-swap attacks routinely steal.
Recovery codes are a second secret. Generate those with the same care as passwords and print them once. A TOTP secret in a screenshot of this page plus no recovery plan is how people lock themselves out.
Clocks matter. If codes fail, check the device NTP skew before you reset the user. Thirty seconds of drift is enough to miss the current window even with a plus-or-minus-one-step allowance.
How to use this tool
- Enter an issuer name — the label users will see in their authenticator app.
- Enter the account identifier, usually an email address.
- Generate the secret and scan the resulting QR code with any authenticator app.
- Verify the app's code matches before enabling 2FA for a real account.
Tips
- Always issue backup codes at enrolment; people lose phones, and without a recovery path they lose the account.
- Store the shared secret encrypted at rest — it is equivalent to the second factor itself.
- Allow a small time window either side to tolerate clock drift on the user's device.
Privacy & how it works
Everything happens inside your browser. The values you type are held in page memory only, are never sent to a server, and disappear when you close the tab. You can confirm this in your browser's network tab: the only request a tool makes is one that names the tool for a usage count, with nothing you typed in it. The tools also work with the internet disconnected. Randomness comes from crypto.getRandomValues(), the browser's cryptographically secure generator, not Math.random(). Math.random() is seeded predictably and must never be used for anything security-related, because an attacker who learns part of the sequence can reconstruct the rest.
Frequently asked questions
- Is TOTP better than SMS codes?
- Considerably. SMS is vulnerable to SIM swapping and network interception, whereas TOTP secrets never travel after enrolment.
- What happens if the user loses their phone?
- Without backup codes or a recovery route, they are locked out. Always provide single-use backup codes when 2FA is enabled.
- Why is the code always six digits?
- Six is the RFC 6238 default and balances usability against guessing risk. Eight digits are permitted where stronger protection is needed.
Browse other tools
All tools run entirely in your browser — nothing you type is sent to a server, except the optional HIBP 5-character hash prefix.