How to Generate a 2FA Code From a Secret Key
A secret key is an essential part of many authenticator-based security systems. It allows compatible software to generate temporary verification codes without requiring a new code to be sent by SMS for every login.
If you have the correct TOTP secret key for an account you own or manage, you can use a compatible tool to calculate its verification codes.
The AuthenticatorTool 2FA Code Generator is a browser-based option for working with time-based authentication codes.
What Is a 2FA Secret Key?
An authenticator secret key is a shared value used to calculate time-based one-time passwords.
When you enable authenticator-based two-factor authentication, the service typically provides a QR code or a manual setup key. An authenticator uses that information to calculate verification codes, while the service uses its corresponding stored secret to verify them.
A secret key is not the same as a temporary verification code. The secret may remain valid until the authenticator configuration is reset, while the generated code changes regularly.
How to Generate a Code From a Secret Key
Step 1: Obtain Your Authorized Secret Key
Open the security settings of the account you administer. During authenticator setup, look for the manual configuration option.
Copy the Base32-encoded secret key carefully. If the service has replaced the secret since the original setup, the old key may no longer work.
Step 2: Open an Online Generator
Visit the AuthenticatorTool website and locate the secret-key input field.
Confirm that you are using the intended website before entering authentication information.
Step 3: Enter the Secret Key
Paste the secret into the appropriate field. Some generators automatically ignore spaces.
If the key is rejected, check for missing characters, accidental punctuation, or transcription errors.
Step 4: Configure the TOTP Parameters
Common settings include:
- Time step: 30 seconds
- Code length: six digits
- Hash algorithm: SHA-1
These are standard defaults rather than universal requirements. Use the configuration specified by the original authentication service.
Step 5: Generate Your Verification Code
The generator calculates a code based on the secret key, current time, and selected settings. Submit the code to the corresponding service before it expires.
Why Is My Secret Key Generating the Wrong Code?
Several issues can cause a generated code to differ from the expected result.
Incorrect secret key: A single incorrect character can change the output. Check the original authorized setup information.
Incorrect device time: TOTP relies on time. Enable automatic date and time synchronization if your device clock is inaccurate.
Mismatched parameters: The code length, algorithm, or time step may not match the service’s configuration.
Expired code: A code entered too late may no longer be accepted. Try a fresh code.
Reset authenticator setup: If the service generated a new secret, the previous key will not produce valid codes for the new configuration.
Is It Safe to Use a Secret Key Online?
Your secret key is sensitive because someone who obtains it may be able to generate valid authentication codes.
Before using an online tool, check whether its implementation processes the key locally or sends it to a server. Local processing can reduce server-side exposure, but it does not eliminate every browser or device security risk.
For highly sensitive accounts, use a trusted authenticator application or hardware security key where supported.
Never share secret keys or recovery codes with strangers.
Secret Key vs. Verification Code
| Secret key | Verification code |
|---|---|
| Used to calculate authentication codes | Generated from the secret and time |
| Usually remains unchanged until reset | Commonly changes every 30 seconds |
| Must be kept confidential | Must be submitted before it expires |
| Used by the authenticator and service | Used during the verification process |
Frequently Asked Questions
Can I convert a secret key into a six-digit code?
Yes. A compatible TOTP generator can calculate a six-digit code when supplied with the correct secret and parameters.
Can I recover a lost secret key from an old code?
A temporary code is not a practical way to recover the underlying secret. Use the service’s official recovery or authenticator-reset procedure.
Why does the code change every 30 seconds?
That is the common default TOTP interval. Other time intervals may be configured by some services.
Where can I generate a code from a secret key?
Visit the AuthenticatorTool 2FA Code Generator to explore compatible time-based code generation.
Generate Your Verification Code
If you have a compatible secret key and know the required TOTP settings, use the AuthenticatorTool online generator to calculate a verification code.
