TOTP Authenticator
Only A–Z and 2–7; lowercase and spaces are ignored. The demo secret above (JBSWY3DPEHPK3PXP) is a public example, not a real account.
🔒 Computed with crypto.subtle HMAC, 100% in your browser. Nothing is sent anywhere — refresh the page and the secret is gone.
⚠️ A website can claim anything about not sending your secret. Only paste a real 2FA secret here if you accept that risk — for production accounts, a dedicated authenticator app on your own device is the safer home (see FAQ).
Copied to clipboard.
Previous / next codes are shown because most servers accept one step of clock skew — if your code fails, try the previous one before assuming the secret is wrong.
Copied to clipboard.
Model. Counter = floor(Unix time ÷ period); code = dynamic-truncate(HMAC-SHA(secret, counter)) mod 10^digits. A 6-digit code has only 1,000,000 possibilities — its safety comes from the 30-second window plus server rate limiting, not from being hard to guess.
How TOTP works
Both sides share one secret. Every 30 seconds (or 60, if the service chose so), the counter ticks up by one, both sides feed the secret and the counter into HMAC, and a few bytes are taken out of the result to make the code. No network, no counter syncing — just a shared secret and a shared clock.
Check it yourself — RFC 6238 test vectors
These are the official test values from RFC 6238, Appendix B. Secret
12345678901234567890 (Base32
GEZDGNBVGY3TQOJQGEZDGNBVGY3TQOJQ), 8-digit codes:
- Unix time 59, SHA-1 → 94287082 (6-digit: 287082)
- Unix time 1111111109, SHA-1 → 07081804
- Unix time 1234567890, SHA-1 → 89005924
- Unix time 2000000000, SHA-1 → 69279037
Paste the Base32 secret above, pick SHA-1 and 8 digits, and this page's math reproduces those numbers exactly — the implementation is verified against all 18 RFC vectors (6 times × 3 algorithms) before every release.
A TOTP code proves you hold the secret right now. It does not prove the secret was never copied: anyone who has seen the secret can generate the same codes forever, which is why a leaked secret must be revoked and re-issued, not just waited out. And if you lose the secret, you lose the account's second factor — save the secret (or the QR code) in your password manager when you set up 2FA.
FAQ
What is TOTP, and how does it work?
TOTP (RFC 6238) is the algorithm behind authenticator apps: you and the server share a secret, and both sides compute HMAC(secret, counter), where the counter is the current Unix time divided by 30 seconds. A few bytes are taken out of the HMAC and reduced modulo 1,000,000 to make a 6-digit code. Because both sides use the same clock, the codes match — and because the counter ticks every 30 seconds, each code expires fast.
Should I paste my real 2FA secret into this page?
Only if you accept the risk. This page has no backend and sends nothing anywhere — the code is public on GitHub and you can inspect it — but any website can claim that, so a pasted secret is only as safe as your trust in the page. For production accounts, a dedicated authenticator app on your own device is the safer home for the secret. This tool is best for learning, testing, and accounts where you understand the trade-off. Never paste a secret into a page you reached from a link you did not trust.
Why is a 6-digit code secure enough?
It is not secure because it is hard to guess — 6 digits is only 1,000,000 possibilities. It is secure because each code lives for 30 seconds and the server rate-limits guesses, so an attacker cannot try enough codes in one window. The secret itself is the strong part; the code is just a short-lived proof that you hold it.
My code does not work — what is wrong?
Almost always the clock. TOTP depends on both sides agreeing on the time, so if your device clock is off by more than 30 seconds the codes will not match. Turn on automatic time sync and try again. This page shows the previous and next codes too, because most servers accept one step of clock skew; if even those fail, the secret itself is probably wrong — check for a missing character.
SHA-1, SHA-256 or SHA-512 — which should I use?
Whichever your service used when it issued the secret — the algorithm is part of the secret's setup, not a choice you make afterwards. SHA-1 is the default in almost every authenticator app and remains fine here, because HMAC-SHA-1 is not broken the way plain SHA-1 hashing is. If a service offers SHA-256, use it; the code will be different for the same secret and time.
What is the otpauth:// link?
It is the standard URI format authenticator apps use to import an account — the same data a QR code carries when a service shows you one. Copy it into an authenticator app that accepts manual URI import, or use it to move an account between apps. It contains your secret in plain text, so treat it like the secret itself: never share it or paste it into a chat.