How to Find Your 2FA Key

Where to find the Base32 secret key on each platform, how to read it out of a QR code, and why the key is not the same as the code.

Last updated: Sep 30, 2026 16:12:13

The 2FA secret key is the string behind the QR code — the value an authenticator app stores so it can compute codes later. It is not the six-digit code, and it is not your password. Knowing where to find it is what lets you move to a new phone, recover on a laptop, or generate a code when the app is unavailable.

This page covers what the key looks like, where each platform hides it, how to read it out of a QR code, and what to do when a service will no longer show it — which happens more often than people expect.

What the key looks like

A secret key is Base32: uppercase letters A–Z and the digits 2–7, nothing else. Typical lengths are 16, 24 or 32 characters, often printed in groups for legibility:

JBSWY3DPEHPK3PXP
JBSW Y3DP EHPK 3PXP
jbswy3dpehpk3pxp

All three lines above are the same key. Case does not matter, spaces are formatting, and trailing = padding is optional. What does matter: if the string contains 0, 1 or 8, it is not a Base32 key — you are looking at the wrong string, or a character was substituted when it was copied.

The key is more valuable than any code it produces. Whoever has it can generate valid codes indefinitely, from any device. Store it the way you store a password, not the way you store a receipt.

Where services show it

Almost every service exposes the key during setup, and almost none exposes it afterwards. The pattern to look for is “Can’t scan the QR code?” or “Enter setup key manually” — that is the door to the text value.

Platform Where to look during setup After 2FA is on
Google account Security → 2-Step Verification → Authenticator → “Can’t scan it?” Not shown. Generate new backup codes instead, or re-enrol the authenticator.
Microsoft account Security → Advanced security options → Add a new way to sign in → Authenticator app → “I can’t scan the QR code” Not shown.
Apple ID No Base32 key exists — Apple’s two-factor uses codes shown on trusted devices, not TOTP Not applicable; use a trusted device or a recovery key.
GitHub Settings → Password and authentication → Enable 2FA → “Setup key” link under the QR Not shown. Regenerate or re-enrol.
Most banks and SaaS Security settings → Two-factor → “Can’t scan?” or “Show secret” Usually not shown; some allow re-enrolment only after identity verification.

If you are still in the setup flow, copy the key before pressing “Next”. It takes five seconds now and saves an hour later.

Reading the key out of a QR code

A QR code is not an image of a secret — it is a rendered URI. Decode it as text and the key is right there:

otpauth://totp/Example:alice@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&algorithm=SHA1&digits=6&period=30

The pieces:

How to decode one:

  1. Use a QR reader that shows the raw text rather than immediately adding the account — on desktop, a screenshot plus any QR-to-text tool works.
  2. Read the secret= value. Stop at the next &.
  3. If what you see starts with otpauth-migration://, you have a multi-account bundle (Google Authenticator export format), not a single key. This generator does not accept that format — you will need to decode the bundle into individual entries first.

Getting it from an existing authenticator app

If the account is already enrolled and the service will not show the key again, the app holding it is your only copy. Whether you can extract it depends entirely on which app:

A practical rule: if you need the key for an account that lives only in a closed app, ask why. If the goal is moving to a new phone, the app’s own migration flow is usually safer than extracting secrets by hand.

When the key cannot be found

Be prepared for this answer, because it is common: most services will not reveal a 2FA key after enrolment. That is deliberate — if support could show it, support could be social-engineered into showing it.

Your options, in order of preference:

  1. Use a backup code. It bypasses the authenticator entirely and is single-use. This is the reason backup codes exist.
  2. Use a signed-in session. If you are already logged in somewhere, you can often re-enrol the authenticator without proving the old one.
  3. Re-enrol. Only when you have working access. It replaces the factor, and your old codes stop working immediately.
  4. Account recovery. Identity verification through the provider. Slow, sometimes impossible, and the last resort.

Do not reset before checking why the code is failing — a clock problem looks identical to a lost key, and resetting does not fix a clock.

Why services hide the key after setup

It is worth understanding the reason, because it explains why “just ask support” rarely works. The server must keep a copy of the secret to verify your codes, so hiding it is not a cryptographic limitation — it is a policy choice. The reasoning:

The practical consequence: treat the moment the key is displayed as your only chance to save it. If you missed it, work with backup codes and re-enrolment rather than looking for a hidden menu.

Sanity-checking a key in ten seconds

Before you paste a key anywhere, three checks catch almost every copy error:

  1. Alphabet. Only A–Z and 2–7. A 0, 1 or 8 means it is not Base32.
  2. Length. After removing spaces, the character count should be a multiple of 8 — 16, 24 or 32 are the common sizes.
  3. Decoded size. Those lengths decode to 10, 15 and 20 bytes. A key that decodes to fewer than 10 bytes is below the RFC 4226 minimum and should be treated as truncated.

If a key passes all three and still produces codes the service rejects, the problem is parameters or the clock, not the key.

If you hit a migration bundle instead of a key

Exporting from Google Authenticator does not produce individual keys. It produces a QR code containing an otpauth-migration://offline?data=… URI, where the data is a base64-encoded protobuf holding every account, its secret, issuer, algorithm, digits and type.

Two implications:

For most people the safer route is to use the app’s own migration flow to move to a new phone, and to keep the bundle only as a short-lived backup while migrating.

What to do with the key once you have it

Three legitimate uses:

Handling the key safely

A key pasted into the wrong page is a permanently compromised account. Before you paste anywhere:

For the wider picture — what the key is used for and how the code is derived — see what TOTP is. If you have the key but the code still fails, the troubleshooting checklist covers the eight causes in order.

Frequently asked questions

What does a 2FA key look like?

A Base32 string of A-Z and 2-7 only, usually 16, 24 or 32 characters, often printed in groups. Case and spaces do not matter; a 0, 1 or 8 in the string means it is not Base32.

Can I see my 2FA key after setup?

Usually no. Most services display it once during enrolment and never again, because a support agent who can reveal it becomes the easiest way to steal an account.

How do I get the key from a QR code?

Decode the QR as text, not as an account. The result is an otpauth:// URI, and the secret is the value after secret= up to the next ampersand.

Why does my key contain 0 or 1?

It should not. Base32 excludes 0, 1 and 8 to avoid confusion with letters, so a key containing them was mistyped or substituted by an OCR tool.

Is it safe to paste the key into a website?

Only if the page computes locally and can prove it. This site limits outbound connections by policy, stores nothing, and never sends the key; check the Network panel yourself before trusting any generator.

What if I cannot find the key at all?

Use a backup code, then a signed-in session, then re-enrol while you still have access. Account recovery is the last resort and needs identity verification.