Skip to content
XUtilHub

TOTP Generator – Test 2FA Codes & Authenticator QR Codes

Generate time-based one-time passwords (TOTP) from a Base32 secret, create new 2FA secrets and otpauth QR codes for authenticator apps.

  • Free, no sign-up
  • Runs in your browser, nothing uploaded

About the 2FA Code Generator (TOTP)

Test two-factor authentication: see the current and next 6- or 8-digit codes for a secret key, create new secrets, and get an otpauth QR code to scan with an authenticator app.

Key features

  • Current and next codes with countdown
  • SHA-1, SHA-256 and SHA-512
  • 6- or 8-digit codes, 30- or 60-second periods
  • Generate new Base32 secrets
  • otpauth:// QR code for authenticator apps
  • Verified against the RFC 6238 test vectors

Test two-factor authentication codes

Enter a Base32 secret to see the current one-time code, with a countdown to the next one. Or create a new secret and scan the QR code with an authenticator app to check that your app and your server agree.

How TOTP works

  1. The service and your app share a secret key when you scan the QR code.
  2. Every 30 seconds, both compute HMAC(secret, time ÷ 30).
  3. The result is shortened to 6 digits. If the codes match, you're in.

Standard settings

SettingUsual value
AlgorithmSHA-1
Digits6
Period30 seconds
Secret160-bit (32 Base32 characters)

The otpauth URI

otpauth://totp/Issuer:user@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Issuer&algorithm=SHA1&digits=6&period=30

Password strength checker, secret key generator, and QR code generator.

How to use the 2FA Code Generator (TOTP)

  1. Enter your text, password or settings in the tool above.
  2. Results appear instantly and are calculated in your browser.
  3. Read the explanation and warnings under the result.
  4. Copy what you need. Nothing is uploaded or stored.

Frequently asked questions

What is TOTP?

Time-based One-Time Password (RFC 6238), the system behind the 6-digit codes in Google Authenticator, Microsoft Authenticator and Authy. A shared secret and the current time produce a code that changes every 30 seconds.

Who is this tool for?

Developers adding two-factor authentication to an app, and testers checking that codes match. It's not meant as your everyday authenticator.

Is it safe to enter my secret here?

The code is calculated in your browser and nothing is uploaded. But anyone who sees a secret can generate your codes, so never paste the secret of an important account into any website. Use test secrets.

Why don't my codes match?

Usually the device clock is wrong (TOTP depends on accurate time), or the algorithm, digits or period differ from the service's settings. Most services use SHA-1, 6 digits and 30 seconds.

Are my passwords and files sent to your servers?

No. All checks, hashing and encryption run in your browser using its built-in Web Crypto features. The only network request is the optional breach check, which sends just the first 5 characters of your password's SHA-1 hash, never the password.

Can I trust browser-based security tools?

These tools use the same standard algorithms (AES-GCM, PBKDF2, SHA-2, HMAC) built into your browser. Still, never type the passwords or 2FA secrets of important accounts into any website you don't control.

Do the tools work offline?

Yes. Once a page has loaded, everything except the breach check works without a connection.

Last updated:

Related Security tools