Guide

SECURITY & AUTHENTICATION · RFC 6238 / RFC 4226

TOTP Code Generator,
test & verify 2FA tokens locally.

Generate and verify RFC 6238 TOTP and RFC 4226 HOTP 2FA codes locally in your browser using Web Crypto HMAC. Supports SHA-1/256/512, 6 or 8 digits, otpauth:// URI import/export, previous/next window preview, and clock-skew verification.

Presets
Generated otpauth:// URI
otpauth://••• (click Show above to view secret in URI)
SHA-1 · 6-Digit TOTP30s left
Unix Epoch
—
Time Step / Counter (T)
0

Computed locally via Web Crypto API (HMAC). Secrets stay in page memory and are never transmitted.

RFC 6238 TOTP & RFC 4226 HOTP · Uses your local device clock.100% client-side · Zero storage

HOW IT WORKS

Time-based and counter-based one-time passwords via Web Crypto.

1. Zero-Upload Web Crypto HMAC

Every token is computed inside your browser using native crypto.subtle.sign('HMAC') and dynamic truncation per RFC 4226 / RFC 6238—no backend ever sees your Base32 secret.

2. Previous & Next Window Preview

Seeing the −1 and +1 time-step codes alongside the live token makes it effortless to test server clock-skew tolerances and grab a fresh code before the countdown hits zero.

3. Provisioning URI Builder

Generate a cryptographically random 160-bit Base32 secret and copy a spec-compliant otpauth:// URI ready for QR encoding or unit tests.

Frequently Asked Questions

Does this TOTP generator upload or store my 2FA secret?

No. All HMAC-SHA computations run locally via your browser’s Web Crypto API (crypto.subtle). Secrets remain only in volatile page memory and are never saved to localStorage or sent over the network.

Which algorithms and authenticator settings are supported?

It supports SHA-1 (standard Google Authenticator / Authy), SHA-256, and SHA-512, 6-digit or 8-digit codes, custom TOTP periods (such as 30s or 60s), and RFC 4226 counter-based HOTP.

Why does my TOTP code not match my authenticator app?

TOTP depends on your device clock being synchronized to UTC. Check the Previous (−1) and Next (+1) codes or use the ±1 step Drift Verifier to see if your system clock is off by 30 seconds, and confirm the secret, algorithm, digits, and period match.

Can I import or generate an otpauth:// URI?

Yes. Paste any otpauth://totp/... or otpauth://hotp/... URI to load its parameters automatically, or click Generate 160-bit Secret to create a fresh Base32 key and copy a ready-to-use otpauth:// URI for testing.

What is the difference between TOTP and HOTP?

HOTP (RFC 4226) generates a one-time code from a shared secret and an incrementing integer counter, whereas TOTP (RFC 6238) replaces that counter with the current Unix timestamp divided by a fixed period (usually 30 seconds).