Crypto & Hash

OTP Generator & TOTP Authenticator — 2FA Codes

Generate automatically refreshing TOTP and OTP codes for two-factor authentication. View adjacent time windows, scan a QR code, and copy derived values locally.

Free to use No sign-up Runs in your browser

Tool workspace

Use 16 to 128 Base32 characters (A-Z and 2-7).

Your secret stays in this browser and is never uploaded.

Refreshes in 0s
Enter a Base32 secret key above to generate TOTP codes

What Is an OTP Generator and TOTP Authenticator?

This OTP generator implements the TOTP algorithm defined in RFC 6238. It creates short-lived two-factor authentication codes from a Base32 shared secret and the current time. Services such as Google, GitHub, and AWS use compatible TOTP codes as an additional layer beyond passwords. The current code refreshes automatically at the end of each configured time window, usually every 30 seconds.

How to Use This OTP Generator

  1. 1Enter the Base32-encoded secret key provided by the service you want to authenticate with.
  2. 2Choose the algorithm (SHA-1 is default for most services), digit count (6 or 8), and period (30s or 60s).
  3. 3The tool displays the previous, current, and next TOTP codes with a live countdown timer.
  4. 4Scan the QR code or open the otpauth URI to add the key to a compatible authenticator.
  5. 5Copy any code or derived value; time-sensitive values refresh automatically.

Common Use Cases

Testing 2FA Implementation

Verify your server-side TOTP validation logic by generating codes from a known secret.

Emergency Code Generation

Generate TOTP codes without a phone-based authenticator app when you have the base32 secret backed up.

Multi-Algorithm Verification

Test TOTP codes with different algorithms (SHA-256, SHA-512) to ensure your service supports them correctly.

Frequently asked questions

Is it safe to enter my TOTP secret here?

Yes. This tool runs entirely in your browser using the Web Crypto API. No data is sent to any server. However, never share your TOTP secret with untrusted websites.

What is a Base32 secret key?

Base32 is an encoding that uses the letters A-Z and digits 2-7. When you set up 2FA, the service provides a secret key in Base32 format, often alongside a QR code.

Why does my code not match my authenticator app?

Ensure the algorithm, digit count, and period match your service settings. Most services use SHA-1, 6 digits, and a 30-second period. Also verify your device clock is accurate.