What is a 2FA secret key?
The secret key is a random string the website creates when you turn on authenticator-based 2FA. It is usually 16 to 32 characters long and written in Base32, for example JBSW Y3DP EHPK 3PXP. Your authenticator uses it, together with the time, to create your 6-digit codes.
You will see it under names such as secret key, setup key, text code, manual entry key or 2FA key. They all mean the same thing.
Where websites show the setup key
During 2FA setup, most websites show a QR code first. The text version of the key is usually one click away:
- Open the account's security or password and security settings.
- Start two-factor authentication or 2-step verification and choose authenticator app.
- When the QR code appears, look for a link such as "Can't scan the code?", "Enter a setup key", "Copy key" or "setup key".
- Copy the key that appears, or write it down exactly.
For example, GitHub shows a setup key link under its QR code. You will find platform-specific steps in our guides for Facebook, Google and GitHub.
Menu names can change over time. If a link looks different, look for wording about entering a key manually.
Only have a QR code? That works too
A 2FA QR code simply contains your secret key in a link that starts with otpauth://. You do not need to extract it by hand. In the 2FA QR code scanner you can:
- click Scan QR and hold the QR code in front of your camera, or
- click the upload button and choose a screenshot of the QR code, or
- copy the QR image and press Ctrl+V (Cmd+V on a Mac) anywhere on the page.
The tool reads the key from the image directly in your browser and starts showing your 2FA code straight away.
Can I find the secret key for 2FA I set up earlier?
Usually not. For security reasons, most websites only show the secret key once, during setup. If you did not save it, you have two options:
- If your old authenticator still works, log in, then turn 2FA off and on again (or choose "change authenticator app"). The website will show a new key.
- Some authenticator apps can export or transfer accounts. Use only the app's own official export feature.
If you have lost access completely, read how to recover a 2FA account.
How to store your secret key safely
Anyone who has your secret key can create your 2FA codes, so treat it like a password:
- Save it in a trusted password manager or write it on paper kept somewhere safe.
- Never send it by email or chat, and never type it into a website someone sent you a link to.
- Keep the account's backup codes next to it.
No real support team will ever ask for your secret key or your 2FA code. If someone asks, it is a scam.
Frequently asked questions
What does a 2FA secret key look like?
It is usually a string of 16 to 32 capital letters and the digits 2 to 7, often shown in groups of four, for example JBSW Y3DP EHPK 3PXP. Spaces do not matter.
Is the setup key the same as the secret key?
Yes. Setup key, secret key, text code and manual entry key are different names for the same value used to create your 2FA codes.
Can I use the QR code instead of the key?
Yes. The QR code contains the same secret key. You can scan it with your camera or upload a screenshot in our 2FA code generator.
Why can I not see my secret key again?
Most websites show the key only during setup. To get a new one, log in and set up the authenticator again from the security settings.