Free TOTP / Authenticator Code Generator

Generate TOTP 2FA codes from a secret key. Compatible with Google Authenticator. Free, fast, and works entirely in your browser with no sign-up required.

Updated

Share:
Home/Utility Tools/TOTP / Authenticator Code Generator

TOTP / Authenticator Code Generator

Generate TOTP 2FA codes from a Base32 secret key. Compatible with Google Authenticator, Authy, and all standard TOTP apps.

Secret Key

How to Use

Google Authenticator / Authy

  1. Open the authenticator app and add a new account manually.
  2. Enter the Base32 secret key from your service's 2FA setup page.
  3. Compare the code shown here with the app — they should match.

GitHub / Google / Dropbox

In your account security settings, enable 2FA and choose "Authenticator App". Copy the secret key or scan the QR code into your authenticator app. Use this tool to verify codes manually.

Security note: Never share your TOTP secret. This tool processes everything locally in your browser — your secret is never sent to any server.

Frequently Asked Questions

What is TOTP?

TOTP (Time-based One-Time Password) generates 6-digit codes that change every 30 seconds, used for two-factor authentication.

Is my secret key safe?

Yes — the secret never leaves your browser. All computation is done locally.

Is it free?

Yes, completely free.

Does the TOTP / Authenticator Code Generator work on mobile devices?

Yes, the TOTP / Authenticator Code Generator is fully responsive and works on smartphones and tablets. You can use it on any device with a modern web browser -- no app download required.

Do I need to create an account to use this tool?

No account or registration is needed. Simply open the TOTP / Authenticator Code Generator in your browser and start using it immediately. There are no sign-up walls or usage restrictions.

How do I use the TOTP / Authenticator Code Generator?

Simply enter your input in the provided field, adjust any settings to your preference, and the tool will process it instantly. You can then copy the result to your clipboard or download it.

Which browsers are supported?

The TOTP / Authenticator Code Generator works in all modern browsers including Chrome, Firefox, Safari, Edge, and Opera. For the best experience, use the latest version of your preferred browser.

Why does my TOTP code not match my authenticator app?

The most common cause is a clock difference: TOTP combines your secret with the current time, so if this device or your phone is even a few seconds off, the generated code can lag or jump ahead. Make sure both devices use automatic, network-synced time. The second common cause is the secret itself — a mistyped, truncated, or wrong-format Base32 key produces valid-looking but incorrect codes. This generator helps you isolate the problem because it shows the previous, current, and next codes side by side, so a code that is merely one 30-second step out of sync is easy to spot. Paste your exact Base32 secret here and compare all three codes with your app; if none line up, the secret is the issue, not the timing.

What is the difference between a Base32 secret and an otpauth:// URI?

A Base32 secret is just the raw key a service shows when you pick "enter setup key manually" — a short string of letters and digits like JBSWY3DPEHPK3PXP. An otpauth:// URI is the full provisioning string encoded inside a 2FA QR code; it wraps that same secret together with extra metadata such as the issuer (service name), the account label, and sometimes the digit count and time step. Both ultimately carry the same secret, so either one is enough to generate codes. This tool accepts both: type the Base32 key directly, or paste the entire otpauth:// URI and click Parse to extract the secret while also reading out the issuer and account. Use whichever form your service hands you and the generator does the conversion for you.

Why does this tool show previous and next codes alongside the current one?

Authentication servers rarely accept only the exact current code. To forgive small clock drift and the seconds between reading a code and submitting it, most servers also accept a code from the adjacent 30-second window. Showing the previous (expired) and next (upcoming) codes makes that tolerance visible: if a login accepts a code that looks one step behind, you can see exactly why. It also makes debugging easier — when this generator and your authenticator app disagree by a single step, the matching value is usually sitting right there in the previous or next slot, confirming the secret is correct and only the timing is slightly off. Paste your secret and watch all three codes roll over together as the countdown bar reaches zero.

How long is a TOTP code valid before it changes?

By default a TOTP code is valid for one 30-second time step, which is the interval virtually every authenticator app and service uses. Because the window is anchored to absolute clock time rather than when you opened the page, codes change on the half-minute boundary — not exactly 30 seconds after you start looking — so the time remaining on a fresh code can be anywhere from 1 to 30 seconds. This generator uses the standard 30-second step and shows a live countdown bar that turns amber and then red as expiry nears, so you always know whether to use the current code immediately or wait for the next one. When the bar empties, the code refreshes automatically. Open the tool to see the countdown and grab a code while it is still fresh.

Is this TOTP generator accurate enough to use as a backup authenticator?

Yes, for the standard case. It implements RFC 6238 exactly as the major services expect: 6-digit codes, a 30-second time step, HMAC-SHA1 hashing, and RFC 6238 dynamic truncation, all computed in your browser with the Web Crypto API. As long as you supply the correct Base32 secret and your device clock is accurate, the codes it produces are identical to those from Google Authenticator, Authy, or Microsoft Authenticator. The caveat is non-default setups: a handful of services use SHA-256, SHA-512, 8 digits, or a different time step, and those will not match here. Treat it as a way to verify or temporarily recover access, not a replacement for securely storing your secret. Paste your secret to confirm your codes line up before you rely on them.

Embed This Tool

Add a free, live version of this widget to your own website or blog post — it runs entirely in your visitors' browsers, with a credit link back to The Toolbox.

Copy & paste this HTML
<iframe src="https://getthetoolbox.com/embed/totp-gen" title="Free TOTP / Authenticator Code Generator — The Toolbox" width="100%" height="240" style="max-width:480px;border:1px solid #e2e8f0;border-radius:12px" loading="lazy"></iframe>
<p style="font-size:12px;margin:4px 0 0"><a href="https://getthetoolbox.com/utility-tools/totp-gen?utm_source=embed&utm_medium=widget" target="_blank" rel="noopener">Free TOTP / Authenticator Code Generator</a> by The Toolbox</p>

About the TOTP / Authenticator Code Generator

This tool turns a two-factor authentication secret into the same rolling 6-digit codes you would see in Google Authenticator, Authy, or Microsoft Authenticator. Paste the Base32 secret from a service's 2FA setup screen — or a full otpauth:// URI — and it shows the code valid right now, the one that just expired, and the one coming up next, all refreshing automatically. It is built for developers testing a login flow, support engineers reproducing a customer issue, and anyone who wants to verify that a freshly added account is producing the right codes before they rely on it.

Everything happens in your browser. The secret is decoded and the codes are computed locally using the Web Crypto API, so nothing you type is uploaded, logged, or stored. There is no sign-up and no app to install. Because the secret never leaves your device, you can safely paste a real 2FA key — though, as with any one-time password, you should never share that secret with anyone else.

What TOTP is and how the code is built

TOTP, short for Time-based One-Time Password, is the open standard (RFC 6238) behind nearly every authenticator app. It combines your shared secret key with the current time to produce a short code that changes on a fixed schedule. The defaults this generator uses match what the major services expect:

  • 6 digits per code, the universal authenticator-app length.
  • A 30-second time step, so a new code appears twice a minute.
  • HMAC-SHA1 as the hashing algorithm, with RFC 6238 "dynamic truncation" reducing the hash to six digits.
  • Base32-encoded secrets, the format services hand you when you choose "enter setup key manually."

A countdown bar shows exactly how many seconds the current code stays valid, turning amber and then red as expiry approaches, so you know whether to use the code now or wait for the next one.

Why it shows previous, current, and next codes

Authentication servers usually accept a code from the adjacent time window, not just the exact current one, to forgive small clock differences and the moment between reading a code and submitting it. By displaying the previous (expired) and next (upcoming) codes alongside the current one, the generator makes that tolerance visible. If a login accepts a code that looks "a step behind," you can see why, and you can confirm your output matches an authenticator app even when the two devices are a second or two out of sync.

Two ways to load a secret, plus a demo key

You can feed the generator a secret in whichever form your service gives you:

  • Raw Base32 secret — type or paste the setup key (for example, JBSWY3DPEHPK3PXP); spaces are stripped and letters are uppercased automatically.
  • otpauth:// URI — paste the full provisioning string that sits behind a 2FA QR code, and the tool extracts the secret while also reading out the issuer (the service name) and account label.

If you just want to see how the process works without using a real account, the Demo button generates a fresh random 160-bit secret you can experiment with. The active secret is always shown and copyable, so you can move it into a password manager or an authenticator app.

Practical uses and a security reminder

People reach for a tool like this to confirm a service's 2FA setup is generating valid codes before logging out of an existing session, to debug an authenticator integration during development, or to recover access when the secret is saved but the original app is not. Treat the TOTP secret like a password: anyone who holds it can generate your codes indefinitely. This generator keeps the computation on your machine, but guarding the secret stays your responsibility — store it somewhere encrypted, and clear it from this page when you are done.