RFC 6238 Compliant

TOTP Generator

Free online TOTP generator for two-factor authentication. Generate RFC 6238 compliant codes, scan QR codes, save secrets to your vault, and auto-copy. 100% client-side — your secrets never leave your browser.

Generator

Generate your TOTP code

Import from QR Code

Vault

Saved Secrets

Your secrets are stored locally in your browser's localStorage. They never leave your device.

No saved secrets yet. Generate a code and save it to your vault.

What is a Time-based One-Time Password (TOTP)?

A Time-based One-Time Password (TOTP) is an algorithm that computes a temporary, single-use passcode from a shared secret key and the current Unix timestamp. As defined in RFC 6238, TOTP is the global standard powering two-factor authentication (2FA) across major platforms like Google, GitHub, AWS, and Microsoft. Our web application provides a secure, browser-based implementation allowing you to generate and verify authentication codes instantly without installing native mobile apps.

How This Online Authenticator Operates

The generator implements the official RFC 6238 specification using your browser's native Web Crypto API. When you provide a Base32-encoded secret, the tool performs HMAC cryptographic hashing (HMAC-SHA-1, HMAC-SHA-256, or HMAC-SHA-512) against the current 30-second epoch counter. All computations execute 100% client-side on your device — your keys and generated tokens never cross the network or touch remote servers.

You can paste a Base32 secret directly or use your device camera to scan standard otpauth:// QR codes. The scanner parses algorithm type, digit length (6 or 8 digits), and refresh interval automatically, displaying a live countdown ring so you always know when your code refreshes.

In-Depth Comparison:Read our full security analysis on why SMS verification is vulnerable to SIM swap attacks in our guide:TOTP vs SMS: Why SMS 2FA Puts Your Accounts at Risk →

Why Use a Web-Based Authenticator?

While mobile authenticator apps are common, desktop and browser-based generators solve critical workflows for developers, sysadmins, and security teams. Whether you need to test authentication flows, recover credentials on a secondary workstation, or manage automated test suites, our tool gives you full transparency with clock drift diagnostics, persistent encrypted vault storage, and instant clipboard shortcuts.

Unlike basic code generators, this tool functions entirely offline after the initial page load. It works seamlessly across macOS, Windows, Linux, iOS, and Android without requiring account creation or third-party cloud synchronization.

Developer-Grade Cryptographic Reference

For engineers integrating 2FA into applications, this generator serves as a verified reference implementation. It supports standard test vectors from RFC 6238, enabling you to compare HMAC-SHA outputs and debug time-step synchronization errors between your server backend and client authenticators.

Full support is provided for HMAC-SHA-1 (the authenticator default), HMAC-SHA-256, and HMAC-SHA-512 for higher-security enterprise environments. The built-in drift calculator displays local clock offset to help diagnose authentication mismatches before deploying to production.

Instant Camera Scan:You can automatically scan any 2FA QR code with your webcam or upload a screenshot right now via theOnline QR Scanner Tool ↑

Core Features & Capabilities

Optical QR Scanner: Scan 2FA setup QR codes directly using your device camera or upload image files to automatically extract and parse otpauth:// URI parameters.

Local Encrypted Vault: Safely store multiple 2FA profiles with custom labels in browser localStorage. Your keys persist across sessions and never leave your machine.[Scan QR Code]

Automatic Clipboard Copy: Enable automatic clipboard copy upon token refresh, or press Ctrl+C to copy active codes without taking your hands off the keyboard.[Open Local Vault]

Dynamic Expiration Ring: A visual countdown ring transitions from green to amber and red in the final seconds, ensuring you never submit an expired authentication token.

Adaptive Theme: Features a high-contrast dark mode tailored for low-light environments, automatically synchronizing with your operating system preference.

Clock Drift Detection: Diagnose clock synchronization discrepancies between your local system time and standard NTP time to prevent verification rejections.[Learn More About Our Architecture]

Zero-Knowledge & Privacy-First Architecture

Privacy is central to our architecture. No trackers, telemetry, third-party analytics, or external cookies exist on this platform. Cryptographic math uses Web Crypto API primitives exclusively in memory. Clearing your browser data purges all saved vault records permanently.

Universal Compatibility

Our implementation is fully compatible with standard authenticator applications, including Google Authenticator, Microsoft Authenticator, 1Password, Bitwarden, Authy, and Duo Mobile. Any service providing standard RFC 6238 secrets can be generated and validated here.

FAQ

Frequently Asked Questions

How can I generate a TOTP code?

To generate a TOTP code, enter your Base32-encoded secret key in the input field above, select your preferred algorithm (SHA-1, SHA-256, or SHA-512), choose 6 or 8 digits, and click 'Generate TOTP.' The tool will instantly produce a time-based one-time password that refreshes every 30 seconds. You can also scan a QR code with your camera or upload a QR image to auto-fill the secret.

What is TOTP used for?

TOTP (Time-based One-Time Password) is used for two-factor authentication (2FA) to add an extra layer of security to online accounts. When you log in, you enter your password plus a temporary 6 or 8-digit code generated by an authenticator app or this TOTP generator. Services like Google, GitHub, AWS, Microsoft, and banking apps use TOTP to protect accounts from unauthorized access, even if your password is compromised.

Is TOTP better than SMS?

Yes, TOTP is significantly more secure than SMS-based 2FA. SMS codes can be intercepted through SIM swapping, SS7 attacks, or social engineering. TOTP codes are generated locally on your device using a shared secret and the current time, so they are never transmitted over a network. This makes TOTP immune to SIM swap attacks, SIM cloning, and SMS interception. Security experts and organizations like NIST recommend TOTP over SMS for two-factor authentication.

What are the benefits of using TOTP?

TOTP offers several key benefits: Enhanced security — codes expire every 30 seconds, making them useless if intercepted. No network required — codes are generated offline on your device. Cross-platform compatibility — works with Google Authenticator, Authy, Microsoft Authenticator, and dozens of other apps. No SIM dependency — immune to SIM swap and phone number hijacking attacks. Wide adoption — supported by Google, GitHub, AWS, Dropbox, and most major online services.

How to generate a TOTP?

To generate a TOTP, you need a shared secret key provided by the service you're authenticating with. Enter this Base32-encoded secret into the generator above. The tool uses the RFC 6238 algorithm to combine your secret with the current timestamp, producing a unique code that changes every 30 seconds. You can use our online TOTP generator, install an authenticator app on your phone, or use a JavaScript TOTP generator library in your own applications.

What is the difference between a TOTP and an OTP?

OTP (One-Time Password) is a general term for any password that is valid for only one login session or transaction. TOTP (Time-based One-Time Password) is a specific type of OTP that uses the current time as a factor in generating the code. While all TOTPs are OTPs, not all OTPs are TOTPs. Other OTP types include HOTP (HMAC-based, uses a counter instead of time) and SMS OTP (sent via text message). TOTP is the most popular form of OTP for two-factor authentication due to its balance of security and usability.

Is TOTP secure?

Yes, TOTP is highly secure when implemented correctly. The security relies on the secrecy of your shared key, the difficulty of guessing it (typically 160+ bits of entropy), and the short 30-second validity window. A new code is generated every 30 seconds, so even if an attacker captures your code, it expires quickly. TOTP is resistant to replay attacks, phishing (when used with hardware keys), and offline brute-force attacks. The main risk is if the shared secret itself is compromised, which is why you should always store it securely.

How to get TOTP from QR code?

When a service provides a QR code for 2FA setup, it contains an otpauth://totp/ URI with your secret embedded in it. To use this TOTP generator, click 'Scan with Camera' and point your device camera at the QR code, or click 'Upload QR Image' to select a saved QR code image file. The tool will automatically decode the QR code, extract the secret, and configure the algorithm, digit count, and time period. You can also manually extract the secret= parameter from the URI and paste it into the input field.

What are TOTP codes?

TOTP codes are temporary, single-use passwords typically 6 or 8 digits long that are generated using the Time-based One-Time Password algorithm (RFC 6238). Each code is valid for a short window, usually 30 seconds, after which a new code is generated. These codes are used as the second factor in two-factor authentication — you enter them alongside your password when logging in. TOTP codes are generated by combining a shared secret key with the current time using HMAC-SHA-1, SHA-256, or SHA-512 hashing.

How do I find my TOTP code?

Your TOTP code is generated by your authenticator app (like Google Authenticator, Authy, or Microsoft Authenticator) or by entering your secret into this online TOTP generator. When a service asks for your 2FA code, open your authenticator app to see the current 6 or 8-digit code. If you don't have an authenticator app set up, use our generator above by entering the secret key you saved when enabling 2FA on your account. The code refreshes automatically every 30 seconds.

Have more questions about 2FA security or authenticator setup?

Explore our complete knowledge hub covering SMS vulnerabilities, SIM swap defense, QR code extraction, and recovery key backups.