UtilityToolsLab

© 2026 UtilityToolsLab. Built and maintained by the UtilityToolsLab Team.

Free eBooks·About·Changelog·Privacy Policy·Terms of Service·Report a bug
HomeAuth, Privacy & ValidationTOTP Generator

Related Tools

Suspicious URL Check2FA QR BuilderCard ValidatorEmail Validator

TOTP / 2FA Code Generator

Generate time-based one-time passcodes from a Base32 secret using RFC 6238, entirely in your browser. Configure the algorithm, digit count, and refresh period.

You Might Also Like

All Auth, Privacy & Validation

Suspicious URL Check

Read a link before you click it: decodes punycode, spots the @ trick, mixed-script homographs and brand-in-subdomain. The link is read, never fetched.

2FA QR Builder

Build the otpauth:// URI for a TOTP or HOTP account and render it as a scannable QR code. SHA-1/256/512, 6–8 digits, 30–90s period. Nothing uploaded.

Card Validator

Validate any card number with the Luhn algorithm. Detects Visa, Mastercard, Amex, Discover and more. Shows IIN, CVC length, and formatted display.

Email Validator

Check one address or a whole list for syntax errors, mistyped providers, disposable domains and role accounts. Nothing is uploaded or looked up.

The six digits your authenticator app shows every thirty seconds aren’t random. They’re an HMAC signature over the current time, truncated down to something short enough to type before it expires. TOTP Generator runs that exact RFC 6238 algorithm locally, signing with the browser’s own crypto.subtle implementation rather than a hand-rolled substitute.

Reach for it when you’re debugging a 2FA integration and need to see what code your server should be expecting without reaching for your phone, checking a backup secret before you commit to relying on it, or building something that consumes TOTP codes and needs known-good test values. Paste a secret, or generate a fresh one, and a code appears immediately.

Running Your First Code

  1. Paste a Base32 secret into the Base32 Secret field, exactly the string an app would show under “Can’t scan this code?”, or click the dice icon for a random one.
  2. Watch the code fill in on its own. A bad character produces a message instead of a blank field, such as “Invalid Base32 character: "1" — only A–Z and 2–7 are allowed.”
  3. Leave Algorithm, Digits and Period on their defaults unless you’re testing a non-standard setup — SHA-1, 6 digits, 30 seconds is what real authenticator apps expect.
  4. Click Copy before the progress bar fills, or check the Previous / Next row underneath if the code you typed elsewhere doesn’t match what’s shown here.

How It Calculates the Code

Every code is HOTP(secret, counter) truncated to however many digits you asked for, where counter is the current Unix time divided by the period and rounded down — RFC 6238 layered on RFC 4226’s HMAC-based one-time password. A freshly generated secret decodes to 20 bytes, a 160-bit key, which is the length HMAC-SHA1 is built around; a shorter pasted secret still works, just from less entropy. This implementation has been checked against all four published RFC 6238 test vectors, the same seed and timestamps the spec itself uses to verify a compliant implementation, and matches every one of them exactly.

When Not to Use This for a Live Account’s Secret

Typing a real account’s TOTP secret into any web page, this one included, gives that page’s JavaScript the same access to it a keylogger would have. That trade is fine for a throwaway secret you generated to test something, and it is not fine for the secret behind your email or your bank. Nothing here is written to disk: the value lives in React state and disappears on refresh, but “gone on refresh” is a much weaker guarantee than a dedicated authenticator app makes. For an account that actually matters, use the app your provider issued the QR code for in the first place.

Code Settings

Algorithm

Digits

Period (seconds)

SHA-1, 6 digits, 30s is what nearly every authenticator app expects. Change these only if you are testing a custom TOTP implementation.

······
Refreshes in—

Computed locally with crypto.subtle — the secret never leaves this tab.

How it works

Paste the Base32 secret an authenticator app would normally scan as a QR code — the “can’t scan this code?” text underneath it — or click the dice icon for a fresh random one to test with. The code updates on its own every time the period elapses, computed with HMAC over a counter derived from the current Unix time, exactly as RFC 6238 defines it.