How to test TOTP codes online
Paste a Base32 secret key, the kind shown under a 2FA QR code as "enter this key manually", and the generator shows the current 6-digit code with a countdown to the next one. Compare it with the code your app or server expects. Use Load sample to try it with a test secret.
To check an authenticator app end to end, copy the Authenticator setup URI, turn it into a QR code with the QR Code Generator, and scan it. The app and this page should show the same code.
How TOTP works
Time-based one-time passwords (RFC 6238) are built from a shared secret and the current time. The time is divided into 30-second steps, and the step number is signed with the secret using HMAC-SHA1, then cut down to 6 digits. The server does the same calculation, so the codes match without any network connection.
This generator uses SHA-1, 6 digits and a 30-second period, the defaults used by Google Authenticator and most other apps. Codes that use SHA-256, 8 digits or a 60-second period won't match.
Why codes don't match
- The clock is off. Codes depend on the time, so a device clock more than about 30 seconds out gives different codes. Many servers accept the previous and next code to allow for small drift.
- The secret is wrong. Base32 uses the letters A to Z and the digits 2 to 7 only, so 0, 1, 8 and 9 mean a typo. Spaces, lowercase letters and trailing
=are fine; they're ignored. - The secret is in another format, such as hex or raw bytes, instead of Base32.
- The settings differ: a different hash, number of digits or period.