Toolstia / TOTP code generator
TOTP code generator
Enter a Base32 secret and see the current one-time code, refreshed every second, with the time left before it changes. It follows RFC 6238, the same standard authenticator apps use, with SHA-1, SHA-256 or SHA-512 and 6 to 8 digits.
This makes the same six-digit codes as an authenticator app, following RFC 6238, using the secret key you were shown when you set up two-factor login. It is handy for testing your own login system. Do not paste the secret of an account you care about into any website, because anyone holding the secret can make your codes.
How it works
- Enter the Base32 secret key.
- Choose digits, period and algorithm if they differ from the usual 6, 30 and SHA-1.
- Read or copy the current code.
How it works
The secret and the current time step, which is the time divided by the period, are fed into an HMAC. A few digits of the result become the code.
Useful for developers
Test a login system, check that your server accepts codes within the right window and debug clock drift.
Keep secrets private
Anyone with a secret can generate your codes. Use only test secrets here, never the key of an account you care about.
Clock accuracy
Codes depend on your device clock. If a code is rejected, check that your time is set automatically.
Questions
Is the secret sent anywhere?
No. Everything happens in your browser, and nothing you enter is sent anywhere.
Why does my app show a different code?
Check the digits, period, algorithm and that the secret matches exactly. Spaces and dashes in the secret are ignored.
What is a typical secret?
A string of capital letters and the digits 2 to 7, like JBSWY3DPEHPK3PXP.