What are TOTP and HOTP?
HOTP (RFC 4226) derives a short numeric code from a shared secret and a counter using HMAC. TOTP (RFC 6238) replaces the counter with the current 30-second time step, which is what most authenticator apps show.
Apps receive the secret through an otpauth:// URI, usually as a QR code. This tester builds and reads those URIs, shows the codes your server should accept, and flags settings that break real apps, such as non-SHA-1 algorithms or 8 digits that some apps ignore.
How to use this tool
- Generate a 160-bit secret, or paste an otpauth:// URI and click Load.
- Scan the QR code with an authenticator app and compare its code with the current code here.
- Paste a code under Verify to see whether it matches and how many steps of clock drift it has.
Frequently asked questions
Is the secret sent anywhere?
No. Codes are computed in your browser with HMAC, and the secret is kept in memory only: it isn't saved or shared.
Why don't my app's codes match?
Check the device clock first, then the algorithm, digits and period: several popular authenticator apps ignore anything but SHA-1, 6 digits and 30 seconds.
How long should a TOTP secret be?
RFC 4226 requires at least 128 bits and recommends 160 bits (32 Base32 characters). The tester generates 160-bit secrets.