TOTP / HOTP Generator for Secure One-Time Passwords
The TOTP / HOTP Generator creates one-time passwords from a shared Base32 secret. TOTP uses the current time, while HOTP uses a counter. Choose 6, 7, or 8 digits, SHA-1, SHA-256, or SHA-512, and a time period such as 15, 30, or 60 seconds. A live countdown shows how long the current TOTP code remains valid.
The TOTP / HOTP Generator creates the one-time passwords used in two-factor authentication. It supports TOTP (RFC 6238), which derives a fresh code from the current time and a shared secret, and HOTP (RFC 4226), which derives a code from a counter. The shared secret is encoded as Base32 (RFC 4648), the format carried by QR codes for Google Authenticator.
To generate codes, the tool uses the shared secret with the selected settings. You can choose 6, 7, or 8 digits, SHA-1, SHA-256, or SHA-512, and a TOTP period such as 15, 30, or 60 seconds. A live countdown bar shows how long the current time-based code remains valid. The calculations use WebCrypto HMAC and run locally in your browser.
TOTP and HOTP differ in the value used to derive each code: TOTP uses time, while HOTP uses a counter. Both formats produce one-time passwords from a shared secret, but the distinction matters when testing or working with a particular two-factor authentication flow. Use the generator to prepare codes for test data, check an authenticator workflow, or compare the two standards.
The TOTP / HOTP Generator runs in your browser, and no data is sent to a server. It has no server dependency, so after the page loads it continues to work offline. This makes it useful for developers and DevOps engineers who need codes for local testing, fixtures, documentation, or development tasks without sending the shared secret elsewhere.
Step 1: Enter the shared secret in Base32 format, the encoding used in authenticator QR codes.
Step 2: Set the available options: choose 6, 7, or 8 digits and SHA-1, SHA-256, or SHA-512.
Step 3: Choose a time period for TOTP, such as 15, 30, or 60 seconds.
Step 4: Generate the one-time password and check the live countdown to see how long the current TOTP code remains valid.
Step 5: Copy the values you need for your test, fixture, or other workflow.
Use case: Generate TOTP or HOTP values for authentication tests, fixtures, and seed data instead of typing example codes by hand.
Use case: Create a batch of codes at once when preparing test data, as an alternative to inventing values manually.
Use case: Produce codes according to the selected standard and settings rather than relying on guesses entered at a keyboard.
Use case: Check how a shared Base32 secret produces a one-time password when testing an authenticator workflow.
Use case: Compare time-based TOTP codes with counter-based HOTP codes while developing or debugging two-factor authentication.
Use case: Prepare example one-time passwords for documentation, demonstrations, or other development work.