About the TOTP Code Generator
This tool computes time based one time passwords (TOTP) in your browser. You paste a Base32 secret or an otpauth:// link and the page shows the current 6 or 8 digit code, the live countdown, and the next code. It follows the RFC 6238 method and uses your local device clock. Nothing is uploaded or stored by FreeToolr; the secret stays on your device while the page runs. People who use it include developers debugging 2FA, system administrators checking server sync, and users who need a quick code without installing an app. The tool accepts standard TOTP parameters and makes it easy to test clock drift and algorithm settings without a server round trip.
How to use it
- 1Paste or type a Base32 secret or an otpauth:// URI into the input field.
- 2Read the current 6 or 8 digit code and the 30 second countdown timer.
- 3Copy the current code to use for login or testing and check the shown next code if needed.
- 4Clear the input when finished to remove the secret from the page memory.
Worked example
Input: 20 byte secret '12345678901234567890' with SHA-1, digits 8, and time = 59 seconds since Unix epoch. Result: 94287082 (RFC 6238 test vector).
How it works
T = floor((Unix_time - T0) / X) (T0 usually 0; X default 30 seconds)
Compute H = HMAC_SHA(K, 8-byte big-endian(T))
Dynamic truncation: offset = low-order 4 bits of H[last byte]; binary = H[offset..offset+3] & 0x7FFFFFFF
Code = (binary mod 10^Digits), left-pad to Digits
Defaults: Algorithm SHA-1, Digits = 6, X = 30s; implementations MAY accept adjacent windows (±1) to allow clock driftSource: RFC 6238 - TOTP: Time-Based One-Time Password AlgorithmRFC 4226 - HOTP: An HMAC-Based One-Time Password AlgorithmNIST Special Publication 800-63B - Digital Identity Guidelines. Last checked 5 November 2026.
What it is good for
- Runs entirely in your browser; no secret upload or server storage.
- Shows current and next codes plus a live 30 second countdown for quick debugging.
- Accepts Base32 secrets and otpauth:// links for easy testing and migration checks.
- Not an authenticator app or secure vault; do not rely on it for long term secret storage.
Questions people ask
What is a TOTP code?
TOTP stands for Time Based One Time Password. It combines a shared secret and the current time window, usually 30 seconds, to make a short numeric code. The method is defined in RFC 6238.
How often does the code change?
The standard step is 30 seconds, so you get a new code every 30 seconds. Some services use other periods, but 30 seconds is the most common.
Is it safe to paste my 2FA secret here?
This page runs the generator locally in your browser and does not upload secrets. Still, avoid pasting account secrets into unfamiliar sites. For high value accounts, use a trusted authenticator app.
Why do my codes not match the service?
Mismatch can come from a wrong secret, wrong digits or algorithm, or clock skew. Check your device clock and try the previous or next code window if the server allows it.
Can I use SHA-256 or SHA-512?
Yes. RFC 6238 permits SHA-1, SHA-256, and SHA-512. Most providers use SHA-1 with 6 digits. Check the service's otpauth:// parameters if provided.
Does FreeToolr store my secret?
No. The secret stays in your browser memory while the page runs. Clear the input or close the tab to remove it from the page session.
Help keep every tool free
FreeToolr stays free because people help it grow. Share a tool you like, tell us what to build next, or support us on Ko-fi.