Skip to content

TOTP Generator

Paste a 2FA secret key and get the same 6-digit codes as Google Authenticator. Everything runs in your browser, so the key never leaves this tab.

Settings (most sites use SHA-1, 6 digits, 30 s)

The key stays in this tab. It isn't uploaded, saved or put in the address bar; closing the tab forgets it.

Current code

— — —

— s left · next code —

An online authenticator that keeps your key private

Two-factor authentication apps show a new code every 30 seconds. That code is calculated from a secret key and the current time with the TOTP standard (RFC 6238). Paste the same key here and you get the same code: useful for testing a 2FA setup, checking a backed-up key, or getting a code when your phone isn't with you.

How to get a 2FA code from a secret key

  1. Paste the secret key. Copy the setup key a site shows under its 2FA QR code ("can't scan?" or "enter a setup key") and paste it. Spaces and lower case are fine. You can also paste a full otpauth:// link or read the QR code from a screenshot.
  2. Check the settings. Almost every site uses SHA-1, 6 digits and a 30-second period. otpauth links fill these in for you; change them only if the site says so.
  3. Copy the code. Type or copy the 6-digit code before the countdown runs out. The next code is shown too, in case you are close to the end of the window.

Where to find your secret key

When you turn on 2FA, most sites show a QR code with a link such as "Can't scan it?" or "Enter a setup key". That reveals the key, usually 16 or 32 letters and digits 2–7. If you only have the QR code, take a screenshot and use Or read a 2FA QR code from an image.

For developers

  • Codes follow RFC 6238 and pass its published test vectors for SHA-1, SHA-256 and SHA-512.
  • Use Create a 2FA QR code to generate a test secret and otpauth URI for your sign-up flow, then compare the code your server expects.
  • Allow one step of clock drift (±30 s) on the server, and store secrets encrypted.

Privacy and safety

The page uses your browser's built-in Web Crypto API. There is no server step, nothing is saved and the key isn't put in the URL, so it won't end up in your history. Close the tab when you are done. Anyone who has your secret key can make your codes, so never share it, and keep your real 2FA keys in an authenticator app.

Making QR codes for other things? Try the QR Code Generator, or read any QR code with the QR Scanner.

Related tools and guides

TOTP and 2FA code FAQ

Is my secret key sent to a server?

No. Codes are calculated in your browser with the Web Crypto API using the standard TOTP algorithm (RFC 6238). The key isn't uploaded, logged, saved in your browser or added to the address bar. After the page has loaded you can go offline and it keeps working.

Will the codes match Google Authenticator?

Yes, if the secret and settings are the same. Google Authenticator, Microsoft Authenticator, Authy, 2FAS and this page all use the same TOTP algorithm, so the same key gives the same 6 digits at the same moment.

My code is rejected. What's wrong?

Usually the device clock. TOTP codes depend on the exact time, so turn on automatic date and time on your phone or computer. Also check that you copied the whole key, and that the site doesn't use 8 digits, SHA-256 or a 60-second period.

Should I use a website as my main authenticator?

For important accounts, keep your 2FA keys in an authenticator app on your phone or a password manager. This page is best for testing a 2FA setup, developers checking their TOTP code, getting a one-off code when your phone is out of reach, or checking that a backed-up key still works. Never paste a key on a computer you don't trust.

What is an otpauth:// link?

It is the text inside a 2FA QR code, for example otpauth://totp/GitHub:you?secret=JBSWY3DPEHPK3PXP&issuer=GitHub. It carries the secret key plus the account name, issuer, algorithm, digits and period. Paste it here or read it from a screenshot of the QR code.

Can I import a Google Authenticator export?

Not directly. Exports use an otpauth-migration:// link that packs several accounts together in a different format. Use each account's original setup key or QR code instead.

What does 'Create a 2FA QR code' do?

It makes a random 160-bit secret and the matching otpauth link and QR code, so you can test 2FA in your own app or share a key with an authenticator. Scan it, and the app should show the same code as this page.