What it does
Two-factor codes (the 6 digit numbers in an authenticator app) are not random. They are worked out from a shared secret and the clock, using a standard recipe called TOTP (time-based one-time password, RFC 6238). A counter-based cousin, HOTP (RFC 4226), uses a number that goes up by one each time instead of the clock.
This page runs that recipe on your device with the browser’s built-in crypto. Paste a secret in Base32 (the letters and digits 2 to 7 that apps show under “enter the key by hand”) or a whole otpauth:// link, and it shows the current code, a countdown to the next one, and the next code. You can also type a code you were given and see whether it matches, allowing one step either side for clocks that are a little off. It is made for testing your own setup: building a login with 2FA, checking an authenticator app, or confirming that a server and a phone agree. Never paste the secret of a real account on a shared or public computer. If you want to look at the building block behind it, see the HMAC and bcrypt tool, and for the secrets and passwords around it, the password generator.
How to use it
- Paste the secret in the first box. A link starting with
otpauth://also works and fills in the options for you. - Pick Time-based (TOTP) or Counter-based (HOTP).
- Read the code. For TOTP the bar shows how many seconds are left before it changes.
- To check a code, type it in the last box. It says which step it matched: this one, the one before or the one after.
What each option does
- Method: TOTP uses the clock; HOTP uses a counter you set.
- Hash: SHA-1 is what nearly every authenticator app uses. SHA-256 and SHA-512 are in the standard but fewer apps support them.
- Digits: 6 is normal; 8 is allowed by the standard.
- Step: how many seconds a code lasts. 30 is normal; 60 is also seen.
- Test at a fixed time: use a Unix time instead of now. This is how the RFC test vectors are checked.
- Window: servers usually accept the code just before and just after the current one, so a phone clock that is a few seconds out still works. The checker does the same.
Worked example
The RFC 6238 test secret is the ASCII text 12345678901234567890, which in Base32 is GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ. At Unix time 59 seconds, with SHA-1, 8 digits and a 30 second step, the code is 94287082. At time 1111111109 it is 07081804. Set these in the fixed-time option and you should see exactly those numbers.
FAQs
Why does my code not match my phone? The most common cause is a wrong clock on one side. Phones set time automatically; a server or PC may not. Also check the hash, digits and step match the app’s settings.
Is it safe to paste my secret? The page works offline and sends nothing. Still, anyone who has the secret can make your codes, so never use a real account’s secret on a computer that is not yours. Use a test account.
What is the window? A tolerance of one step either side, so a code from the last 30 seconds or the next 30 still passes.
Can I get a secret out of a QR code? Scan it with your own device, then paste the link here. Only do that for test accounts.
Where the numbers come from
- TOTP: RFC 6238 (IETF, 2011), including its published test vectors. HOTP: RFC 4226 (IETF, 2005). The otpauth:// link layout follows the Google Authenticator key URI format. Checked 2026-12-05.
Standard scientific values, such as constants, atomic weights and melting points, are facts found in every textbook; we name where ours were checked. If you are an author or publisher and want a value, a credit or a table changed or removed, tell us and we will act quickly.
Read more on the Blog
Last updated 2026-12-05.