Key Facts
- Category
- Security & Validation
- Input Types
- text, select, number
- Output Type
- html
- Sample Coverage
- 4
- API Ready
- Yes
Overview
The TOTP / HOTP Offline Code Generator is a secure, local utility that generates RFC 6238 time-based and RFC 4226 counter-based one-time passwords directly from a base32 shared secret. Operating entirely in your browser without sending data to external servers, it supports HMAC-SHA1, SHA-256, and SHA-512 algorithms, outputs 6 or 8-digit codes, and generates standard otpauth:// URIs for easy import into authenticator apps like Google Authenticator or Authy.
When to Use
- •When you need to verify that a raw 2FA base32 seed generates the correct one-time password without using a mobile device.
- •When migrating 2FA accounts to a new authenticator app by generating a standard otpauth:// URI from a raw secret.
- •When testing or debugging custom TOTP/HOTP authentication flows during software development.
How It Works
- •The tool decodes the provided base32 shared secret locally, ignoring any spaces or formatting characters.
- •It computes the current time-step counter for TOTP or uses the specified counter value for HOTP.
- •It applies the selected HMAC algorithm (SHA-1, SHA-256, or SHA-512) and performs dynamic truncation to extract the 6 or 8-digit code.
- •It renders the active code, a real-time countdown, a preview of upcoming codes, and a formatted otpauth:// URI.
Use Cases
Examples
1. Verifying a Standard 2FA Secret
Security Administrator- Background
- An administrator needs to verify that a newly generated backup seed matches the codes generated by a user's hardware token.
- Problem
- Confirming the seed is correct without registering it on a physical phone.
- How to Use
- Enter the base32 secret, select TOTP mode, choose SHA-1, set digits to 6, and check the generated code against the token.
- Example Config
-
Secret: JBSWY3DPEHPK3PXP, Mode: TOTP, Algorithm: SHA-1, Digits: 6, Period: 30 - Outcome
- The tool displays the current 6-digit code and a countdown, confirming the seed generates the expected values.
2. Creating an Import URI for a Custom Account
DevOps Engineer- Background
- An engineer wants to distribute a shared 2FA credential to team members for a staging environment.
- Problem
- Generating a standard URI that team members can scan or copy into their authenticator apps.
- How to Use
- Input the shared secret, enter the issuer name and account email, and copy the generated otpauth:// URI.
- Example Config
-
Secret: JBSWY3DPEHPK3PXP, Issuer: StagingEnv, Account: [email protected] - Outcome
- An otpauth://totp/StagingEnv:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=StagingEnv URI is generated for instant import.
Try with Samples
hashRelated Hubs
FAQ
Is my shared secret sent to a server?
No. All calculations are performed locally in your browser, ensuring your 2FA secrets remain completely private.
Which authenticator apps support the generated otpauth URI?
Most major authenticator apps, including Google Authenticator, Authy, Microsoft Authenticator, and 1Password, support it.
What is the difference between TOTP and HOTP?
TOTP generates codes based on the current time (e.g., changing every 30 seconds), while HOTP generates codes based on an incrementing counter.
Can I use secrets that contain spaces?
Yes. The generator automatically ignores spaces and formatting characters when decoding the base32 secret.
Why does the generated code not match my app?
Ensure your system clock is synchronized, and verify that the algorithm (usually SHA-1), digits (usually 6), and period (usually 30s) match your provider's settings.