OTP Generator — Free Online TOTP Code Generator & 2FA Validator
Free online OTP generator for time-based TOTP codes (RFC 6238). Generate one-time passwords, validate 2FA codes, and test your authenticator setup — 100% pri...
To generate a one-time password, enter a Base32 secret or click refresh for a random one; the tool shows the current 6-digit TOTP code and when the next one arrives.
Last updated:
OTP Generator — Free Online TOTP Code Generator & 2FA Validator. Free online OTP generator for time-based TOTP codes (RFC 6238). Generate one-time passwords, validate 2FA codes, and test your authenticator setup — 100% private, runs in browser.
Generate and validate time-based one-time passwords instantly with our free OTP generator . Enter any Base32 secret key and get your current, previous, and next TOTP code in real time — with a live countdown showing exactly when the code refreshes.
Built on the same RFC 6238 algorithm used by Google Authenticator, Authy, and every major 2FA app.
Use the built-in OTP validator to check whether a specific code is valid for your secret, making it perfect for debugging authenticator apps, testing login flows, and verifying QR code setups.
All cryptographic calculations run entirely in your browser — your secret keys never leave your device. Why use an online TOTP code generator?
When setting up two-factor authentication for a new service, you need to confirm that your secret key is correct before locking yourself into an authenticator app.
Our 2FA code generator lets you instantly verify that a seed produces the right codes, confirm that your server-side OTP validation matches, or debug timing issues with the epoch display and iteration counter.
The QR code output lets you scan the secret directly into any authenticator app for quick testing. Need to hash authentication tokens? Our JWT Parser handles token debugging, and the HMAC Generator covers the underlying cryptography.
Frequently asked questions
How do I generate an OTP code online?
Paste your Base32 secret into the Secret field, or click the refresh icon to create a random one. The Current OTP changes every 30 seconds, and the progress bar with its Next in countdown shows how long the code stays valid.
How can I test my authenticator app setup?
Scan the QR code on this page with Google Authenticator, Authy or a similar app, then compare the code in the app with the Current OTP here. If they match, the app and your clock are working; if not, check your device's time settings.
What is the difference between TOTP and HOTP?
TOTP codes change with time, every 30 seconds here, while HOTP codes come from a counter that increases on each use. This tool generates TOTP codes; its Iteration section shows the time-based counter that feeds the HMAC.
Why don't my codes match my authenticator app?
Codes depend on the exact secret and accurate time. Make sure the secret was copied completely and that your computer clock is synced; the Epoch field shows the Unix time the page uses. Services that use SHA-256, 8 digits or a 60-second period will not match.
What do the Secret in hexadecimal, Epoch and Count fields show?
Secret in hexadecimal is your Base32 secret decoded to hex, the key used by HMAC-SHA1. Epoch is the current Unix time in seconds, and Count is that time divided by 30 and rounded down, the counter used for the current code, also shown as padded hex.
How to use this online tool
OTP Generator — Free Online TOTP Code Generator & 2FA Validator is designed for fast browser workflows when you need to format, validate, convert, decode, encode, generate, or inspect data without opening a heavy desktop app. Start with the input field or visible options, review the result, then copy or download the output for the next step.
Private processing in your browser
OTP Generator — Free Online TOTP Code Generator & 2FA Validator keeps the normal processing step local in your browser. That is useful for code snippets, tokens, documents, configuration values, text samples, and other material that should not be sent to a remote service unless you explicitly choose to share it.
When this tool is useful
Use OTP Generator — Free Online TOTP Code Generator & 2FA Validator for repeatable developer tasks, technical documentation, QA checks, quick conversions, debugging, content cleanup, and internal team workflows. The page focuses on clear inputs, immediate feedback, and output that is easy to reuse in code, reports, tickets, emails, or notes.
Practical tips
Before copying the final result, check important details such as spacing, casing, filenames, encoding, token structure, line breaks, or output format. Small checks prevent mistakes when the result is reused in source code, API requests, documentation, spreadsheets, or shared files.