TOTP Secret Key Generator — Complete Guide
A complete guide to generating TOTP secret keys — base32 secrets for testing two-factor authentication flows with authenticator apps.
Two-factor authentication built on TOTP relies on a shared secret key that both the server and an authenticator app use to compute the same rotating code. A TOTP secret key generator produces valid base32 secrets so you can build and test 2FA enrolment flows without wrestling with the encoding by hand.
What is the TOTP Secret Key Generator?
A TOTP secret key generator produces base32-encoded secret keys — the random shared secret that time-based one-time password apps like Google Authenticator and Authy use to derive six-digit codes. The TOTP Secret Key Generator gives you valid secrets in the format authenticator apps expect. Because the secret is the foundation of the whole TOTP exchange, having correctly-encoded keys on demand lets you test enrolment, QR provisioning, and code verification in development without a real account or a real secret at risk. It is completely free, runs entirely in your browser, and needs no signup. Nothing you enter is uploaded to a server, there are no usage limits, and you can generate again as many times as you like until a result fits.
How to Use
Generating a secret is quick:
- Choose a key length if the tool offers options.
- Click Generate to produce a base32 TOTP secret.
- Copy the secret into your test enrolment flow or authenticator app.
- Use it to verify your server derives matching codes.
- Generate a fresh secret for each test account.
You can open the TOTP Secret Key Generator and start generating right away. Because it runs instantly and for free, it costs nothing to generate several times and keep the result that works best.
Use Cases
TOTP secrets support authentication work:
- Testing two-factor enrolment and verification flows
- Generating secrets for development test accounts
- Building and debugging QR-code provisioning URIs
- Verifying your code-derivation logic against an app
- Learning how TOTP secrets and codes relate
- Demoing a 2FA setup without a live account
Across all of these, the appeal of the TOTP Secret Key Generator is the same: a fast, unbiased, repeatable result that would take far longer to assemble by hand, available the moment you need it.
Tips
Handle TOTP secrets safely:
- Use generated secrets for testing only — never reuse a test secret on a real account.
- In production, generate the secret server-side and store it encrypted.
- TOTP secrets are base32, not hexadecimal — keep the encoding correct.
- Provision an authenticator via an otpauth:// URI containing the secret to test enrolment fully.
FAQ
What is a TOTP secret key?
It is a random shared secret, base32-encoded, that a server and an authenticator app both hold. Each side combines it with the current time to compute the same six-digit code, which is how time-based two-factor authentication works.
Why is the secret base32 rather than hex?
The TOTP standard and authenticator apps expect base32 because its alphabet avoids ambiguous characters and is easy to type and encode in QR codes. Supplying a hex string would not be read correctly by most apps.
Can I use a generated secret on my real account?
No — treat generated secrets as test material only. For a real account, the server should generate the secret securely and store it encrypted; reusing a public-tool secret would undermine the security 2FA is meant to provide.
How does the app turn the secret into a code?
It runs the HMAC-based one-time password algorithm over the secret and the current time window — usually 30 seconds — and truncates the result to six digits. Because both sides share the secret and the clock, they compute the same code.
How do I load the secret into an authenticator app?
Either type the base32 secret in manually or, more commonly, encode it into an otpauth:// URI rendered as a QR code that the app scans. Generating a test secret lets you build and verify that provisioning flow before going near real user accounts.
Related Generators
If the TOTP Secret Key Generator is useful, you will likely reach for Bulk UUID v4 Generator, API Key Generator, and Hex Token Batch Generator. They pair naturally with it when you are building and testing authentication flows, and exploring a few of them together often turns one quick task into a finished piece of work.
Try the TOTP Secret Key Generator for free at Generator Collection — open the TOTP Secret Key Generator and generate as much as you need. There is nothing to install and no account to create, so you can return and generate more whenever the next project comes along.