Language
English English Vietnamese (Tiếng Việt) Vietnamese (Tiếng Việt) Chinese (简体中文) Chinese (简体中文) Portuguese (Brazil) (Português do Brasil) Portuguese (Brazil) (Português do Brasil) Spanish (Español) Spanish (Español) Indonesian (Bahasa Indonesia) Indonesian (Bahasa Indonesia)
TOTP Generator

TOTP Generator

Generate Time-based One-Time Passwords for two-factor authentication. Supports SHA-1, SHA-256, SHA-512 with QR code import and multi-account management.

What is TOTP?

TOTP (Time-based One-Time Password) is a widely used algorithm for generating temporary authentication codes that change every 30 or 60 seconds. Defined in RFC 6238, TOTP is the standard behind popular authenticator apps like Google Authenticator, Authy, and Microsoft Authenticator.

How it works: TOTP combines a shared secret key with the current time through an HMAC hash function to produce a short numeric code (typically 6 or 8 digits). Because both the server and client share the same secret and use the same time reference, they independently generate matching codes without any network communication.

Common Use Cases

Two-Factor Authentication (2FA)

Add an extra security layer beyond passwords for login systems

Multi-Factor Authentication (MFA)

Combine with biometrics or hardware keys for stronger security

Service Account Protection

Secure API keys, admin panels, and cloud service accounts

Development & Testing

Verify TOTP implementations during app development

How TOTP Works

The algorithm takes a Base32-encoded secret key and the current Unix timestamp, divides the time by the period (e.g., 30 seconds) to get a counter value, then applies HMAC with the chosen hash algorithm (SHA-1, SHA-256, or SHA-512). The result is dynamically truncated to produce the final numeric code.

TOTP Formula
TOTP = Truncate(HMAC-SHA(secret, floor(time / period)))

How to Use the TOTP Generator

Generate Codes from a Secret Key

1

Enter Secret Key

Enter your Base32 secret key in the input field (e.g., JBSWY3DPEHPK3PXP)

2

Auto-Generate Code

The TOTP code will be generated automatically with a countdown timer

3

Adjust Settings

Configure Algorithm (SHA-1, SHA-256, SHA-512), Digits (6 or 8), and Period (30s or 60s) as needed

4

Copy Code

Click the copy button to copy the current code to your clipboard

Import from an otpauth:// URL

1

Paste URL

Paste an otpauth://totp/... URL directly into the input field

2

Auto-Parse

The tool will automatically parse the issuer, account name, secret, and all settings

3

Settings Update

Settings controls will update to match the URL parameters

Import from a QR Code Image

1

Upload QR

Click the Upload QR button (upload icon) in the header

2

Select Image

Select an image file containing a TOTP QR code

3

Auto-Decode

The QR code will be decoded and the otpauth:// URL will be parsed automatically

Save and Manage Accounts

  • After entering a secret, click the Save button to store the account
  • You will be prompted to enter a name for the account
  • Click on any saved account to load its secret and settings
  • Use the pen icon or double-click the account name to rename it
  • Use the X button to delete an account from the saved list

Export as QR Code

1

Load Secret

Enter or load a secret key

2

Show QR

Click the Show QR button (QR icon)

3

Scan & Transfer

Scan with any authenticator app

Features

Multiple Hash Algorithms

Generate TOTP codes with three HMAC algorithms:

  • SHA-1 — Default, most compatible
  • SHA-256 — Enhanced security
  • SHA-512 — Maximum security

Configurable Code Settings

Customize code generation parameters:

  • 6-digit or 8-digit codes
  • 30-second or 60-second periods
  • Auto-adjust from otpauth:// URLs

Real-Time Countdown Timer

Visual progress bar with smart color indicators:

  • Yellow at 33% remaining
  • Red at 5 seconds
  • Next code preview displayed

QR Code Support

Full QR code integration:

  • Import by uploading QR images
  • Generate QR codes from secrets
  • Transfer to mobile authenticator apps

Multi-Account Management

Save and organize multiple accounts:

  • Store unlimited accounts locally
  • Quick-load saved configurations
  • Rename and delete accounts easily

otpauth:// URL Parsing

Automatic URL parameter extraction:

  • Parse secret and issuer info
  • Extract algorithm and settings
  • Standard authenticator format
Your Data Stays Private: All TOTP generation happens in your browser using the Web Crypto API. Secret keys are never sent to any server, we don't collect or log your authentication data, and saved accounts are stored only in your browser's localStorage.

Frequently Asked Questions

What is the difference between TOTP and HOTP?

TOTP (Time-based) uses the current time to generate codes that change every 30 or 60 seconds. HOTP (HMAC-based) uses a counter that increments with each use.

TOTP is more widely adopted because codes expire automatically, reducing the risk of replay attacks. This tool supports TOTP only.

Which algorithm should I use?

SHA-1 is the default and most widely supported algorithm — use it unless the service you're setting up specifically requires SHA-256 or SHA-512.

Most authenticator services (Google, GitHub, AWS) use SHA-1 with 6 digits and a 30-second period.

Why does my code not match the expected value?

TOTP codes depend on accurate system time. If your device clock is off by more than a few seconds, the generated codes may not match.

  • Check that your system time is synchronized
  • Verify algorithm, digit count, and period settings match the service
  • Ensure the secret key is entered correctly

Is it safe to enter my secret key here?

Yes. All computation happens entirely in your browser using the Web Crypto API. Your secret key is never transmitted to any server.

Saved accounts are stored only in your browser's localStorage and are accessible only from this device.

Can I use this instead of Google Authenticator?

This tool generates the same TOTP codes as Google Authenticator and other authenticator apps. You can use it for development, testing, or as a backup code generator.

Recommendation: For daily 2FA use, a dedicated mobile authenticator app is recommended as it's always accessible on your phone.

What format should the secret key be in?

Secret keys should be in Base32 encoding (letters A-Z and digits 2-7).

You can also:

  • Paste a full otpauth://totp/... URL
  • Upload a QR code image

Spaces and padding characters (=) in Base32 keys are automatically removed.

Are my saved accounts backed up?

Saved accounts are stored in your browser's localStorage. They persist across sessions but are not backed up to any cloud service.

Important: Clearing your browser data will remove saved accounts. Consider exporting important secrets as QR codes for backup.
Secret Key

Enter a secret key to generate TOTP code

— — —
30s
Next
QR Code

Scan with your authenticator app

Saved Accounts

No saved accounts

Ready
| |
Enter a Base32 secret key or paste an otpauth:// URL to generate codes instantly
Use the QR upload button to import secrets from authenticator QR code images
Click Save to store accounts locally — the app will prompt you to name the account
Double-click an account name or click the pen icon to rename it
The timer bar turns yellow at 33% and red at 5 seconds remaining
Click Show QR to generate a scannable QR code for transferring to a mobile authenticator
All TOTP generation happens in your browser using Web Crypto API — your secrets never leave your device
Want to learn more? Read documentation →
1/8
Can't find it? Build your own tool with AI
Start typing to search...
Searching...
No results found
Try searching with different keywords