↑

Free TOTP Generator

What this tool does

The TOTP Generator creates time-based one-time passwords — the 6-digit codes used for two-factor authentication — from a base32 secret key. It follows the RFC 6238 standard with HMAC-SHA1, shows the current and next codes with a live countdown, and supports 30 or 60 second periods and 6 or 8 digit codes. Useful for testing 2FA setups and learning how authenticator apps work. Free and private, right in your browser.



The default secret is the public RFC test key ("12345678901234567890"). Codes are computed in your browser and never uploaded — still, treat real secret keys like passwords.
-
Current code
-
Next code
-
Seconds left

Let us know

Please share your experience with this tool.

Thanks for rating!
No ratings yet — be the first!

How do I use the TOTP generator?

Paste a base32 secret key and the current 6-digit code appears instantly, with the next code and a countdown showing how many seconds it stays valid. Choose a 30 or 60 second period and 6 or 8 digits to match your service. The default key is the public RFC test secret — at Unix time 59 seconds it produces 287082, the official test value, so you can verify the tool yourself.

What is TOTP?

TOTP (Time-based One-Time Password, RFC 6238) is the algorithm behind authenticator apps like Google Authenticator and Authy. Instead of sending codes by SMS, your device and the server independently compute the same short code from a shared secret and the current time. The code changes every 30 seconds, so a stolen code quickly becomes useless. It builds on HOTP (RFC 4226), which uses a counter instead of time.

How does the algorithm work?

The secret key is decoded from base32, then combined with the current time step (Unix time divided by the period) using HMAC-SHA1. A few bytes of the hash are selected by dynamic truncation and reduced to 6 or 8 digits. Because both sides run the same math on the same secret and time, they get the same code without communicating. This tool implements the standard exactly — it passes the RFC test vectors.

What is the secret key format?

Secret keys are base32 text: capital letters A-Z and digits 2-7, often shown in groups of 4 with spaces. When you enable 2FA, services show the secret as a QR code (an otpauth:// link) and sometimes as text for manual entry. Spaces and hyphens in the key are ignored here, and lowercase is accepted.

Is it safe to paste my secret here?

This generator runs entirely in your browser — the secret is never uploaded, stored or logged, and the page works offline once loaded. That said, a TOTP secret is as sensitive as a password: anyone who has it can generate your codes forever. Use this tool for testing and learning, prefer your authenticator app for daily logins, and never paste real secrets into websites you do not trust.

Is it free and private?

Yes. The TOTP generator is completely free, needs no sign-up, and runs entirely in your browser. Nothing is uploaded to a server. It works on phones, tablets and desktop computers.

FAQs

What is a TOTP code?

A time-based one-time password: a 6-digit code computed from a secret key and the current time, used for two-factor authentication (2FA). It changes every 30 seconds.

Why does the code change every 30 seconds?

The algorithm divides Unix time into 30-second steps and hashes the step number with your secret. A new step means a new code, so old codes expire quickly.

Where do I get the secret key?

When you enable 2FA on a service, it shows a QR code and usually a text secret key for manual entry. That text key is what you paste here.

My code does not match — why?

Check that the secret is correct, the period (30s) and digits (6) match the service, and your device clock is accurate — TOTP depends on synchronized time.

Is my secret key uploaded to a server?

No. Codes are computed entirely in your browser; the secret never leaves your device.

Is it free?

Yes, completely free with no sign-up. Everything runs in your browser.


Author

Awais Arshad

Web Tools Developer & Content Creator at FastToolKit.