TOTP Code Generator

Enter or generate a Base32 secret, view the current TOTP and countdown for 2FA integration testing.

Read the full guide: OTP and 2FA: TOTP Basics and Integration →

Privacy: processed locally, never uploaded.

↓ Paste in the input area below to see results instantly

RFC 6238 TOTP codes generated locally. Compare with Google Authenticator or similar apps.

Secret (Base32)
Digits
Period (seconds)

186644

Refreshes in 30s

Notes

Usage note

Secret must match your authenticator app. For development only; do not enter production secrets on untrusted devices.

Enter or generate a Base32 secret, view the current TOTP and countdown for 2FA integration testing.

Quick start

  1. Set secret

    Must match the secret in Google Authenticator or similar.

  2. Verify code

    Default 6 digits and 30s period; adjust to match your server.

Development use

Compare against your server otpauth library when building 2FA; never enter real production secrets on public machines.

Typical Workflow

When developing apps requiring 2FA integration, this tool quickly verifies if secret keys are correct. First generate or input a Base32 key, and the tool instantly displays current TOTP code with countdown. The 30-second refreshing codes match Google Authenticator exactly for easy testing.

Keep your mobile authenticator open for real-time comparison during testing. If authentication fails, verify time synchronization (enable NTP) and check for extra spaces in keys. Developers can also pre-generate future TOTP codes for automated testing scripts.

Examples

Period

Input

30s window, 6 digits

Output

Rotating 6-digit code

FAQ

HOTP support?

TOTP (time-based) only; HOTP needs a counter mode.

What if generated codes don't match my mobile app?

First verify time synchronization - >30s difference causes mismatches. Check key input accuracy (case-sensitive, no extra characters). If issues persist, test across browsers or use epoch converters to inspect timestamp baselines.