OTP

TOTP Generator

Generate time-based one-time passwords

Password Security
🔒 100% client-side — your data never leaves this page
Maintained by ToolsKit Editorial TeamUpdated: June 9, 2026Reviewed: June 9, 2026
Page mode
Input

Quick CTA

Enter a Base32 secret or otpauth URI first to generate the current TOTP immediately; parameter notes stay in Deep.

Output
Current Code
Next Code
Time Remaining0s
Time Step0
🔒 100% client-side • HMAC-SHA1 (RFC 6238)
Page reading mode

Deep expands pitfalls, recipes, snippets, FAQ, and related tools when you need troubleshooting or deeper follow-through.

About this tool

Generate and verify RFC 6238 time-based one-time passwords from a Base32 secret or otpauth URI. The tool supports 6/8 digit codes, 30/60 second periods, current and next window output, countdown timing, and optional code verification. Use it to debug Google Authenticator-compatible login flows, validate backend OTP implementations, or inspect issuer onboarding links. All HMAC operations run locally in the browser.

Failure Input Library

Secret pasted with hidden spaces and wrong Base32 cleanup

Bad input: Copying `JBSW Y3DP EHPK 3PXP` directly from docs/email with spaces and mixed formatting.

Failure: Generated OTP does not match authenticator app, leading teams to blame backend verification.

Fix: Normalize the secret to clean Base32 (no hidden whitespace) before any code comparison.

Clock-skew ignored during MFA incident triage

Bad input: Verifying TOTP on a laptop with unsynced time while production servers are NTP-synced.

Failure: Valid secrets appear broken because code windows are shifted by tens of seconds.

Fix: Confirm client/server time sync first, then test with current and adjacent time windows.

Clock drift causes recurring code mismatch

Bad input: Server and client clocks differ by over one time step.

Failure: Users enter valid app codes but server rejects them repeatedly.

Fix: Allow small time-step tolerance and enforce NTP health monitoring.

Secret stored in plain text

Bad input: Raw TOTP secrets are persisted directly in application database.

Failure: Database leak enables large-scale OTP compromise.

Fix: Encrypt secrets at rest and restrict decryption path to auth service.

Unlimited OTP retry attempts

Bad input: Verification endpoint allows infinite retries without throttle.

Failure: Brute-force probability rises and abuse detection is weak.

Fix: Add per-account and per-IP rate limits with lockout policy.

Quick Decision Matrix

Debugging real MFA failures across web/app/backend

Recommend: Use TOTP generator with explicit secret/period/digits and compare with server logs by timestamp.

Avoid: Avoid testing with unknown defaults or unchecked local time settings.

Designing production enrollment UX

Recommend: Use `otpauth://` URI + QR flow for user onboarding and reserve raw secret view for recovery paths.

Avoid: Avoid exposing raw secrets in routine UI steps where screenshots/clipboard leaks are likely.

Rolling out TOTP as mandatory second factor

Recommend: Validate secret provisioning, time sync, and recovery paths together.

Avoid: Avoid enabling mandatory 2FA without clock-drift contingency design.

Customer or employee account security

Recommend: Unique secret per account, encrypted storage, and retry limits.

Avoid: Avoid shared seeds or unlimited verification attempts.

Short-lived isolated demo setup

Recommend: Simplified setup can be used with explicit disposable scope.

Avoid: Avoid promoting demo MFA shortcuts into production auth stack.

Production Snippets

otpauth sample

txt

otpauth://totp/ToolsKit:demo@example.com?secret=JBSWY3DPEHPK3PXP&issuer=ToolsKit&period=30&digits=6

Compare & Decision

Current code vs next code

Current code

Use it for the code that should normally pass right now.

Next code

Use it when a user submits near the rollover boundary and the receiving system allows a small time window.

Note: Seeing both windows makes timing bugs easier to reason about without weakening the actual 2FA policy.

Raw secret vs otpauth URI

Raw secret

Use it when the secret is already extracted and you only need code generation.

otpauth URI

Use it when you want the full TOTP configuration in one transportable string.

Note: The secret is enough to generate codes, but the URI carries the setup context people often forget to check.

Single-app validation vs multi-app interoperability check

Multi-app check

Use for public product enrollment flows.

Single-app check

Use only for internal prototypes.

Note: Interoperability testing prevents support-heavy rollout regressions.

Per-user TOTP secret vs shared team secret

Per-user secret

Use for all real user authentication systems.

Shared secret

Use only for temporary lab devices under strict control.

Note: Shared secrets destroy individual accountability and revocation control.

Direct Answers

Q01

Can this generate and verify 2FA TOTP codes?

Yes. Paste a Base32 secret or otpauth URI, generate the current and next code window, then enter a code to check whether it matches.

Q02

Does it work with Google Authenticator style setup links?

Yes. otpauth://totp links are parsed into secret, digits, period, and issuer-style settings so you can sanity-check the setup.

Q03

Why does a generated code expire so quickly?

TOTP codes are time-window based. Most 2FA apps rotate every 30 seconds to limit replay usefulness.

Failure Clinic (Common Pitfalls)

Testing with the wrong system time

Cause: TOTP depends on current time alignment, so clock drift can make good secrets look broken.

Fix: Confirm device and system time are synced before judging the code mismatch.

Mixing six-digit and eight-digit configurations

Cause: Most consumer 2FA flows use six digits, but some internal systems use eight.

Fix: Match the digits field to the otpauth URI or backend policy before verifying the code.

Copying a secret with spaces or unsupported characters

Cause: Base32 secrets are easy to break when copied from screenshots, docs, or QR decoding tools.

Fix: Remove formatting spaces and verify the secret characters before assuming the authenticator app is wrong.

Scenario Recipes

01

Verify a TOTP secret setup

Goal: Generate and validate a current 2FA code from a Base32 secret or otpauth URI before blaming the login system.

  1. Paste the Base32 secret or the full otpauth URI from your 2FA setup flow.
  2. Confirm the digits and period match the authenticator app or backend configuration.
  3. Generate the current and next code, then type the code from the authenticator app into the verify field.

Result: You can tell whether the problem is the secret, timing window, digit length, copied URI, or clock drift.

02

Check a Google Authenticator migration or test account

Goal: Make sure a copied secret still produces the same six-digit code before it is used in docs, QA, or a staging login flow.

  1. Paste the copied secret or setup URI into the generator.
  2. Compare the generated current window with the app on the same time boundary.
  3. If it fails, check spaces, Base32 characters, digits, period, and device time before changing backend code.

Result: You avoid chasing an auth bug when the real issue is a copied character, wrong period, or unsynced clock.

03

MFA enrollment smoke test across authenticator apps

Goal: Verify generated secrets produce consistent OTPs on major authenticators.

  1. Generate test secret and provision into multiple authenticator apps.
  2. Check OTP match on synchronized clocks at fixed intervals.
  3. Record drift cases and update enrollment guidance.

Result: MFA onboarding issues are caught before customer rollout.

04

2FA enrollment verification before production launch

Goal: Confirm authenticator apps generate consistent one-time codes.

  1. Check shared secret encoding and issuer/account label formatting.
  2. Validate 30-second window behavior across timezone and device clocks.
  3. Document recovery-code fallback for code desynchronization incidents.

Result: 2FA activation flow becomes predictable across client devices.

05

MFA enrollment rollout

Goal: Enable TOTP onboarding with recovery and support workflows ready.

  1. Generate unique secret per account and show QR provisioning URI.
  2. Require one successful TOTP verification before activation.
  3. Issue backup codes and store encrypted secret metadata.

Result: MFA activation is secure and supportable at scale.

06

Clock drift support playbook

Goal: Reduce false MFA failures caused by device time skew.

  1. Log verification windows and mismatch reasons.
  2. Allow narrow adjacent time-step tolerance with rate limiting.
  3. Guide users to sync device time when repeated drift is detected.

Result: Login friction drops without weakening security posture.

Use It In Practice

TOTP Generator is most reliable with real inputs and scenario-driven decisions, especially around "Debugging real MFA failures across web/app/backend".

Use Cases

  • When Debugging real MFA failures across web/app/backend, prioritize Use TOTP generator with explicit secret/period/digits and compare with server logs by timestamp..
  • When Designing production enrollment UX, prioritize Use `otpauth://` URI + QR flow for user onboarding and reserve raw secret view for recovery paths..
  • Compare Current code vs Next code for Current code vs next code before implementation.

Quick Steps

  1. Paste the Base32 secret or the full otpauth URI from your 2FA setup flow.
  2. Confirm the digits and period match the authenticator app or backend configuration.
  3. Generate the current and next code, then type the code from the authenticator app into the verify field.

Avoid Common Mistakes

  • Common failure: Generated OTP does not match authenticator app, leading teams to blame backend verification.
  • Common failure: Valid secrets appear broken because code windows are shifted by tens of seconds.

Frequently Asked Questions

Can this verify a 2FA code from my authenticator app?

Yes. Paste the code into the verification field and the tool checks whether it matches the current or next TOTP window.

Can I use an otpauth URI directly?

Yes. The tool can parse secret, digits, and period from otpauth:// URIs used by authenticator QR codes.

Is it compatible with Google Authenticator?

Yes. It follows RFC 6238 TOTP behavior used by common authenticator apps when secret, digits, period, and time are aligned.

Why does my code differ from another app?

Check the Base32 secret, digits, period, and system time. Clock drift is a common reason for mismatches.

Does the code update automatically?

Yes. Current and next code values refresh with the countdown timer.

Is my secret uploaded?

No. Secret parsing, HMAC calculation, and code verification are fully client-side.

Keep browsing