TOTP 2FA Authenticator Generator
Generate real-time Two-Factor Authentication (2FA) TOTP security tokens from Base32 secret keys. Live 30-second countdown, RFC 6238 compliant.
Runs in your browser · Free, no sign-up · Nothing is stored
🔍 Verify Authenticator Code Match
Test whether a client phone/app token matches this secret within the current 30s window (or ±1 time step drift).
About this tool
This browser-based TOTP generator computes time-based authentication codes directly on your device using the Web Crypto API. It is designed primarily for developers testing multi-factor authentication flows, validating TOTP configurations, and troubleshooting authorized accounts. Enter a Base32-encoded secret, choose 6 or 8 digits and the HMAC algorithm (SHA-1, SHA-256, or SHA-512), and the tool generates the corresponding rolling code on the commonly adopted 30-second time step — with a live countdown, next-code preview, and a verification module to check codes against the secret. Because a TOTP secret can generate future authentication codes, treat it like a sensitive credential: prefer test secrets, and avoid entering secrets for active production accounts unless necessary.
How to use it
What is a TOTP Generator?
TOTP (Time-based One-Time Password) is a time-based extension of the HMAC-based One-Time Password algorithm, defined in RFC 6238. It converts the current Unix time into a time-step counter, then combines that counter with a shared secret through a standardized HMAC calculation to produce a short-lived numeric code. The default time step is 30 seconds, although implementations may agree on other parameters.
Because the calculation is standardized and needs no live server request, compatible generators produce the same code when they use the same secret, time, code length, and algorithm. This tool supports 6- or 8-digit codes with HMAC-SHA1, SHA-256, or SHA-512, on a fixed 30-second period.
How to use it
- Enter your Base32-encoded secret in the secret key field (a sample value is prefilled; click "Generate Random Secret" for testing).
- Select 6 or 8 digits and the HMAC algorithm matching your service's settings. The time period is fixed at 30 seconds.
- Watch the live countdown and progress bar as codes refresh; click the displayed code to copy it, or preview the next code below.
- Use the "Verify Token" button to check whether a code from another authenticator matches this secret within the current or adjacent time window.
Why use this over alternatives
This utility is intended for local TOTP testing and troubleshooting without account creation or app installation. Because the secret can generate future codes, avoid production secrets when a dedicated authenticator or password manager is available.
Questions
- Is it safe to enter an authenticator secret here?
- This tool runs in your browser. However, a TOTP secret is a sensitive credential that can be used to generate future authentication codes. Avoid entering active account secrets on shared, managed, or untrusted devices, and prefer unused test secrets when validating an implementation.
- Why does the code refresh every 30 seconds?
- TOTP divides time into fixed intervals, commonly 30 seconds. The authenticator and server independently calculate a code from the shared secret and the current time-step counter. Each interval produces a different short-lived code, limiting how long a captured code can normally be reused. TOTP codes can still be intercepted through real-time phishing, so they do not provide the same phishing resistance as security keys or passkeys.
- Why was my generated code rejected?
- A code may be rejected if the device clock is inaccurate, the secret was copied incorrectly, the wrong account secret was used, or the generator and server use different settings such as the time period, code length, or hashing algorithm. Codes entered near the end of a time window may also expire before verification. Check the secret and parameters, then enable automatic time synchronization on your device.
- Does this tool work without an internet connection?
- TOTP generation itself needs no network request — it uses only the shared secret and your device's system clock. If the page and all required scripts have already loaded, codes can keep refreshing while offline. Reloading the page without network access may fail unless the site has explicit offline support.
- Does the tool save my TOTP secret?
- No. The tool does not intentionally save the entered secret to our servers or to browser storage. Treat every TOTP secret as sensitive authentication material regardless.
- Can I paste an otpauth URI or scan a QR code?
- This version accepts a Base32-encoded secret only. It does not extract secrets from QR codes or parse complete otpauth URIs — copy the secret string itself from your 2FA setup screen.
- Should I use this as my primary authenticator?
- This tool is intended primarily for testing and troubleshooting. For routine account access, use a trusted authenticator application, password manager, security key, or passkey supported by the service. Keep account recovery codes in a separate secure location. ---
Related tools
All security tools- Hash GeneratorGenerate cryptographic SHA-1, SHA-256, SHA-384, or SHA-512 hashes for any text using the browser Web Crypto API
- JWT DecoderDecode JWT tokens into readable JSON header and payload
- Secure Password GeneratorGenerate strong, random passwords instantly
- Bcrypt Hash Generator & VerifierGenerate secure Bcrypt password hashes and verify plaintext passwords against existing hashes