TOTP Code Generator
Work out the current two-factor code (TOTP) from a secret key or otpauth link, as an authenticator app would.
TOTP Code Generator works out the current two-factor code from a Base32 secret key or an otpauth:// link, exactly as an authenticator app does. It supports 6 or 8 digits, any period and SHA-1, SHA-256 or SHA-512, and shows the next code too.
What is TOTP?
Time-based one-time password
Defined in RFC 6238. The secret key and the current time, counted in 30-second steps, are combined with HMAC to produce a short code. Your phone and the server do the same sum, so the codes match without any connection between them.
Why use TOTP Code Generator?
- Test your own 2FA setup. Developers can check that a server and an authenticator agree on the code for a test secret.
- Reads setup links. Paste the otpauth:// link from a QR code and the digits, period and algorithm are picked up for you.
- Stays on your device. The secret is used in this tab only and never sent.
How to use TOTP Code Generator, step by step

- Paste the secret into TOTP Code Generator. Spaces and lower case are fine.
- Check digits, period and algorithm. Most services use 6 digits, 30 seconds and SHA-1.
- Read the code. It changes every period and this page does not refresh it on its own: edit any field to recompute it.
Frequently asked questions
Is it safe to paste a real 2FA secret?
It is not sent anywhere, but a 2FA secret is as sensitive as a password. Anyone who sees it can make your codes. Prefer a proper authenticator app for real accounts.
Why does my code not match?
TOTP depends on the clock. If your device clock is off by more than a few seconds, codes differ. Also check the digits, period and algorithm.
Does it support HOTP counter codes?
No. It makes time-based codes only.
Looking for the long version? The guides cover each of these jobs in depth.