Skip to content
OTP Generator

Guide

How to Find Your 2FA Secret Key (Setup Key)

Cannot scan the QR code? Learn where to find your 2FA secret key, what a Base32 setup key looks like, and how to extract the key from an existing QR code image.

6 min readUpdated November 12, 2026Fact-checked against RFC 6238

Quick answer

Is the secret key the same as the 6-digit code?

No. The secret key is a long, fixed string, usually Base32 letters and digits, that you set up once. The six-digit code is calculated from that key and the current time and changes every 30 seconds. You only need the key when adding the account to an app.

More answers
On this page

What the secret key is

Every authenticator code is generated from a secret key, sometimes called a setup key, seed, or manual entry key. The website creates it when you turn on 2FA and shares it with your authenticator app exactly once, normally by showing a QR code. After that, your app and the website both use the key, plus the current time, to calculate matching codes.

The QR code is just a convenient wrapper. Inside it is a short link that contains the same key you could type by hand. If you understand that, the rest of this guide is straightforward. For the background, see how TOTP works.

What a secret key looks like

Most 2FA secret keys are written in Base32. You will recognise them by these traits:

  • Only capital letters A to Z and the digits 2 to 7.
  • Never contains 0, 1, 8, or 9.
  • Usually 16 or 32 characters long, though other lengths are possible.
  • Often shown in groups of four, like JBSW Y3DP EHPK 3PXP. The spaces are for readability only.
  • Sometimes ends with one or more = padding characters.

If what you see is six digits that change every 30 seconds, that is a code, not the key. If it is a long list of short codes, those are backup codes, which are something different again.

Where to find it during setup

The easiest time to get the key is when you first enable 2FA on an account. Next to the QR code, most sites include a small link with wording such as:

  • "Can't scan the QR code?"
  • "Enter this text code instead" or "Enter a setup key"
  • "Use a setup key" or "Manual entry"
  • "Show secret" or "View code"

Click it and the site reveals the Base32 key. You can type it into your authenticator app's "Enter a setup key" option and, if you wish, save a copy in a password manager as a backup. Some sites also show the account name and the settings to use, such as time-based, 6 digits, and SHA-1.

If you are already past the setup screen and need the key again, most services will not show it a second time for security reasons. The usual solution is to disable and re-enable 2FA, or choose an option like "change authenticator app", which generates a brand new key and QR code. Remember that the old key stops working once you do this.

Getting the key out of a QR code

If you have the setup QR code as an image, for example a screenshot you saved, you can read the key straight from it. A 2FA QR code contains a link in this form:

otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example

The part after secret= is your key. The link may also include digits, period, and algorithm if the service uses non-default settings, and those matter too.

Our QR code to 2FA secret tool decodes the image in your browser and shows the key and settings, without uploading the picture anywhere. You can then paste the key into the TOTP generator to confirm it produces the codes you expect. If you need to go the other way and turn a key into a scannable QR code, use the 2FA QR code generator.

Getting keys out of an authenticator app

Authenticator apps generally do not display secret keys on screen, on purpose. Your options depend on the app:

  • Google Authenticator can export accounts as special migration QR codes. These use a different format, otpauth-migration://, but our Google Authenticator export decoder can read them locally. See the transfer guide for details.
  • Open-source apps like Aegis or 2FAS let you export an encrypted or plain backup file containing keys.
  • Password managers that store TOTP usually show the key in the item's edit view.
  • Authy does not offer an official export.

Common mix-ups when entering a key manually

Typing a key by hand is where most setup problems start. Watch for these:

  • Look-alike characters. Because Base32 excludes 0, 1, 8 and 9, any of those in your typed key is a mistake. They are almost always the letters O, I or B.
  • Choosing the wrong type. Most apps ask whether the key is time-based or counter-based. Pick time-based (TOTP) unless the service specifically says otherwise.
  • Ignoring the settings. If the setup page mentions 8 digits, a 60-second period, or SHA-256, set those options in your app; manual entry rarely picks them up automatically.
  • Typing the account name into the key field. The name or email is just a label. Only the Base32 string goes in the key field.

After adding the key, always confirm by entering a code on the setup page before you close it. That is your proof the key was copied correctly. If codes fail later, the troubleshooting guide can help.

Keep the key safe

The secret key is effectively a permanent password for your second factor. Anyone who has it can generate valid codes for that account indefinitely. A few precautions:

  • Store copies only in a password manager or encrypted storage, not in plain notes, email, or chat.
  • Never share it with anyone claiming to be support staff. Legitimate services do not ask for it.
  • Delete stray screenshots of setup QR codes from your camera roll and cloud photo library.
  • If you think a key has leaked, reset 2FA on that account to generate a new one.

Only extract keys for accounts and QR codes that belong to you.

Frequently asked questions

Is the secret key the same as the 6-digit code?

No. The secret key is a long, fixed string, usually Base32 letters and digits, that you set up once. The six-digit code is calculated from that key and the current time and changes every 30 seconds. You only need the key when adding the account to an app.

Can I see the secret key again after setting up 2FA?

Usually not. Most services show it only once for security. To get a key again, use the account's option to change or reset your authenticator, which creates a new key. If you saved the original QR code image, you can decode the key from that instead.

Why does my key contain lowercase letters or spaces?

Some sites display keys in lowercase or split them into groups for readability. Base32 is not case sensitive in practice, and spaces are only formatting. Most authenticator apps accept either form, but if one rejects it, remove the spaces and convert the key to uppercase.

Need a code right now?

Paste your key and get the current 6-digit code in seconds. Free, private and nothing to install.