TOTP Secret Generator
The TOTP Secret Generator is a free online tool that creates cryptographically secure Base32 secrets for Time-based One-Time Password systems. It is essential for software developers and security engineers implementing two factor authentication. Use it to generate the foundation for 2FA setups in your web and mobile applications.
How the TOTP Secret Generator works
- 1
Pick a size and label
Choose a Secret size - 80-bit, 160-bit (the standard), or 256-bit - then fill in Issuer and Account so the generated URI names your app and user.
- 2
Process Your Data
The engine draws cryptographically secure random bytes and encodes them as Base32 - the format authenticator apps like Google Authenticator require. It also assembles an otpauth:// URI carrying your issuer, account, and standard SHA1/6-digit/30-second parameters.
- 3
Get Your Results
You receive both the raw Base32 secret for your database and a ready-to-scan otpauth URI. Users add it by pasting the URI into their authenticator or scanning it once encoded as a QR code.
Real-world examples
Implementing 2FA in Custom Apps
Input: Generate 80-bit secret
Results: A 16-character Base32 secret, such as JBSWY3DPEHPK3PXP
Use case: Backend developers use this to create the initial secret key when a user enables 2FA on their account.
Testing Authenticator Apps
Input: Generate 160-bit secret
Results: A 32-character Base32 secret, such as NBSWY3DPEHPK3PXPJBSWY3DPEHPK3PXP
Use case: QA testers use this to verify that their mobile authenticator apps correctly parse longer secret keys.
Enterprise SSO Configuration
Input: Generate 80-bit secret
Results: A 16-character Base32 secret, such as GZSTINJUGM4TINLD
Use case: IT administrators use this to generate secrets for configuring hardware security keys in enterprise single sign-on.
Academic Security Research
Input: Generate multiple 160-bit secrets
Results: List of random Base32 strings
Use case: Cryptography students use this to gather data on the randomness and distribution of generated TOTP secrets.
Blog Tutorial on 2FA Setup
Input: Generate 80-bit secret
Results: A 16-character Base32 secret, such as I65VUHAJ4Z2WY4DZ
Use case: Tech writers use this to provide a working example secret for readers following along with a 2FA implementation guide.
TOTP Secret Generator FAQ
Is an account required to use this tool?
No, you can use this tool instantly without registering or logging in.
Is my data secure and private?
Yes, all processing happens directly in your browser, meaning your secrets are never sent to our servers.
Does the tool work offline?
Once the page is loaded, the core generation engine works entirely offline in your browser.
Is there a character or file size limit?
Sizes come in three fixed flavors - 80-bit (16 Base32 characters), 160-bit (32 characters, the RFC-recommended default), and 256-bit (52 characters). No custom lengths between them.
What is the otpauth URI line for?
It bundles your secret plus the Issuer and Account labels into the standard link authenticator apps import directly. The URI also pins the common parameters: SHA1 hashing, six digits, thirty-second windows.
How is this different from a plain random string generator?
Unlike random string generators, this tool specifically outputs Base32 encoded strings optimized for authenticator apps.
What is the technical working principle?
The tool uses the Web Crypto API to generate secure random bytes, then encodes them using the Base32 alphabet.
What is the most common use case?
Developers most commonly use it to generate the initial secret keys required for implementing two factor authentication.
Why use the TOTP Secret Generator?
- Cryptographically Secure: Uses the browser's secure random number generator for high entropy.
- Base32 Compliant: Outputs strings in the exact format required by Google Authenticator and similar apps.
- Customizable Length: Allows you to adjust the bit length of the generated secret.
- Browser-Based Privacy: Keeps your secrets secure by processing everything locally.
- Zero Setup Required: Works immediately in any modern web browser without installations.
- Completely Free: Offers full functionality without hidden paywalls or premium tiers.
- Instant Generation: Creates secure secrets in milliseconds with a single click.
- Clean Output: Provides clearly formatted Base32 strings ready for your code.
Related tools
More where this came from
The TOTP Secret Generator is one of 250 free tools on Tool Tutor. Bookmark it for quick access next time.
Explore All Tools