QR Codes

What Is a 2FA QR Code, and What's Actually Inside It?

That black-and-white square you scan during 2FA setup isn't just a shortcut — it encodes a specific, standardized URI containing your secret key and account metadata. Here's exactly what's in it and why the format matters.

Nency
Published Sep 14, 2026
4 min read

The Short Answer

A 2FA QR code is a visual encoding of a small piece of text — typically under 200 characters — formatted as a standardized otpauth:// URI. Scanning it with an authenticator app or a browser-based tool like AuthBro simply reads that text out of the image and parses it into your account setup: your secret key plus a few labels for display purposes. There's no hidden data, no external lookup, and no network request involved in the scan itself — everything needed is already encoded directly in the pattern of black and white squares.

The Exact Format Behind the Code

Almost every 2FA QR code follows this structure, defined informally by Google Authenticator's own Key URI Format documentation and now treated as a de facto industry standard:

CODE
otpauth://totp/ServiceName:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=ServiceName&algorithm=SHA1&digits=6&period=30

Breaking this down piece by piece:

ComponentMeaning
totpIndicates this account uses time-based codes (as opposed to hotp, counter-based)
ServiceName:[email protected]The label shown in your authenticator's list — typically the service name and your account identifier
secret=Your Base32-encoded secret key — the only value that actually matters cryptographically
issuer=Metadata used for display and icon matching in supporting apps
algorithm=The hash function used, almost always SHA1 for broad compatibility
digits=Code length, almost universally 6
period=Time-step duration in seconds, almost universally 30

Everything except secret is essentially cosmetic — it affects how the entry is labeled and displayed, not the actual security of the codes generated. For the deeper mechanics of how that secret becomes a six-digit code every 30 seconds, see How TOTP Works Under the Hood.

Why Base32 and Not Something More Compact

The secret itself is encoded in Base32 rather than a more space-efficient format specifically so it can also be typed manually as a fallback if scanning isn't possible. For the full reasoning behind this specific encoding choice, see Understanding Secret Keys, Base32 Encoding, and Time Drift in TOTP.

What a QR Code Does Not Contain

It's worth being explicit about the boundaries here, since misconceptions are common:

  • No password. The QR code has nothing to do with your account password — it exists purely to set up the second factor.
  • No ongoing connection to the service. Once scanned, the authenticator doesn't need to contact the service again to generate future codes.
  • No personal data beyond what's visibly encoded. There's no hidden tracking payload — what you see decoded as plain text is genuinely everything present in the image.

Why This Is Shown Only Once

Services generally display the QR code (and its underlying secret) exactly once, at the moment of setup, and never again afterward. This isn't a UI limitation — it's a deliberate security choice: repeatedly displaying a value this sensitive would create more opportunities for it to be captured by anyone glancing at the screen, a screenshot, or a screen-recording. This is also precisely why losing your authenticator without a saved backup is a real problem rather than a minor inconvenience — the secret genuinely can't be retrieved from the service a second time. See Lost or Expired 2FA QR Code? What to Do for what your options actually are if this happens.

A 2FA QR code isn't magic — it's a compact, standardized way of transmitting one piece of critical data (your secret key) plus a few cosmetic labels, all in a format a camera can read in under a second.
Did you find this helpful?
55

Frequently Asked Questions

Technically yes, as an image — but most services only display it once during initial setup and don't regenerate it afterward, so you typically only get one opportunity to scan or record it before it's no longer shown.
No. It contains your TOTP secret key and a few display labels only. It has no relationship to your account password and can't be used to determine or reset it.
Only if that screenshot is stored somewhere encrypted and secure, since the image contains your full secret key in scannable form — functionally equivalent to writing down the raw key itself.
A standardized otpauth:// URI, typically specifying totp or hotp, the Base32-encoded secret, and metadata like the issuer name, algorithm, digit count, and time-step period.
N

About The Author

Nency

Author is a software developer and technical contributor at AuthBro. They specialize in building performance-oriented browser productivity systems and writing developer guidelines.

Related Guides

Explore additional resources on 2FA security and authentication.