OTP

TOTP Generator

Generate time-based one-time passwords

Password Security
πŸ”’ 100% client-side β€” your data never leaves this page
Maintained by ToolsKit Editorial Teamβ€’Updated: March 31, 2026β€’Reviewed: April 5, 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

Use this tool to generate RFC 6238 time-based one-time passwords from a Base32 secret or an otpauth URI. It supports common authenticator settings such as 6/8 digits and 30/60 second periods, and shows both current and next code with countdown. This is useful when debugging login flows, validating backend OTP implementations, or verifying 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:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=ToolsKit&period=30&digits=6

Compare & Decision

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 more setup context.

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 help inspect an otpauth URI?

Yes. It can parse the secret and timing parameters so you can sanity-check a TOTP setup quickly.

Q02

Why does a generated code expire so quickly?

TOTP codes are time-window based, so they rotate on purpose 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.

Scenario Recipes

01

Verify a TOTP secret setup

Goal: Generate a current code from a secret or otpauth URI to confirm the setup looks correct.

  1. Paste the Base32 secret or otpauth URI.
  2. Generate the current and next code window.
  3. Compare the result with your authenticator or integration test flow.

Result: You can spot formatting or timing mistakes before blaming the auth system.

02

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.

03

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.

04

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.

05

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 Raw secret vs otpauth URI for Raw secret vs otpauth URI before implementation.

Quick Steps

  1. Paste the Base32 secret or otpauth URI.
  2. Generate the current and next code window.
  3. Compare the result with your authenticator or integration test flow.

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

What is TOTP?

TOTP is a time-based one-time password standard used by authenticator apps for two-factor authentication.

Can I use an otpauth URI directly?

Yes. The tool can parse secret, digits, and period from otpauth URIs.

Why does my code differ from another app?

Check that secret, period, digits, and system time are aligned between both sides.

Is this equivalent to SMS OTP?

No. TOTP is generated from a shared secret and time step, while SMS OTP is server-delivered.

Does the code update automatically?

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

Is my secret uploaded?

No. Secret parsing and code generation are fully client-side.