Free · runs in your browser

Two Factor QR Code Generator

Two Factor QR Code Generator. Enter your label, issuer, and secret to instantly draw a scannable two-factor QR code. Choose SHA-1, SHA-256 or SHA-512 and 6 or 8 digits in the totp code generator to match what a service expects.

Your values

Almost every site uses time based codes. Pick counter based only if the setup screen says HOTP.

The setup key shown under the site's QR code, often labelled "enter this key manually". Spaces and dashes are removed for you. Leave it empty to use a random 160-bit secret. It stays in your browser.

The account name shown in the app, usually your username or email.

Optional. The service name; apps use it to pick the account name and icon.

Google Authenticator ignores these settings; Yubico Authenticator and most other apps honour them.

200

Width of the QR image on the page (128 to 512 px). Larger is easier for a phone camera to read from a screen.

Result

otpauth URI (QR code text)
—
How it appears in the app
—
Current code
—
Code refresh
—
QR version and grid
—
Pixels per module
—
Input checks
—
  • No account, no logging
  • Open formulas explained below
  • Works offline once loaded

A two factor qr code generator turns the secret key behind your 2FA setup into a QR code that any authenticator app can scan. You paste the key, confirm a few details, and the tool draws a QR code in seconds, so a new phone or a second app picks up your account without a reset.

How a Two Factor QR Code Generator Works

A 2FA QR code generator does not invent anything new. Your service already gave you a secret key when you first enabled protection, and the generator wraps that key in a short link written in the otpauth:// URI format. That link carries the key, an issuer (who runs the account), a label (which account it is), the number of digits and the refresh period. A qr code generator then draws that text as a square pattern.

Bar chart splitting the 144-character otpauth setup URI into scheme, label, secret, issuer and option characters
The 144-character setup link behind the QR image, by part.

When you generate QR codes this way, the authenticator reads the same data it would have received from the website. Any TOTP code generator built on that data produces matching 6-digit numbers, because both sides share the key and the clock. A basic verification code never travels with the QR code itself, only the ingredients to create one.

  • Secret key: the shared base32 text, for example KRSXG5CTMVRXEZLU
  • Issuer and label: the names shown inside your app
  • Digits and period: usually 6 digits and 30 seconds

Think of 2FA as a lock with two parts: the key you know and the proof your device creates. A generator only helps with the second part, so it never replaces the 2FA settings on the site itself, and it never sees your login.

Time-Based Codes and the 30-Second Countdown

A time-based one-time password is recalculated from the key and the current time, so the real-time number changes on every period. The countdown shows how long you have before the code will expire.

What Two-Factor Authentication Protects

Two-factor authentication adds a second factor to your login, so a stolen password alone is not enough. Hackers who guess or buy your password still hit a wall without that extra step, which is what blocks unauthorized access to your account. That is why security teams ask every person to switch it on for each of their accounts, from email to banks. Copy the output of the free otpauth uri builder to share a Google or Apple friendly enrolment string through a secure channel.

The same 2-factor authentication idea matters when you change your phone. A new phone has no codes yet, and a QR generated from your saved key restores them on the new mobile device. Because online services differ, check how each one handles recovery first, and keep the 2FA rules of the site in mind.

Teams that manage many accounts often keep a short list of which 2FA method each service uses, plus the saved key for each one. A single missed entry is the usual reason a person gets locked out, so a quick verification of every account once a year, by regenerating its QR from the saved key, catches it. App-based verification is also harder to intercept than SMS.

Steps to Set Up 2FA with Google Authenticator

Any 2FA tool follows the same path, and Google Authenticator shows it well. Most authenticator apps behave alike, including Authy.

Flow showing the time counter 58,907,520 becoming an HMAC-SHA1 hash, the integer 376,529,268 and the 6-digit TOTP code 529268
How the example timestamp turns into the 6-digit code 529268.
  1. Open the security settings of the service and enable two factor authentication.
  2. Choose the authenticator option and copy the key shown, or keep the QR on screen.
  3. Type the key into the generator with an issuer such as Northwind Mail and a label such as [email protected].
  4. Scan the result with the camera in your authenticator app.
  5. Enter the 6-digit temporary verification code to finish.

Some options sit under advanced options, such as SHA-256, 8 digits or a 60-second period. Google Authenticator ignores them, while the Yubico Authenticator and many others respect them, so test in the app you plan to use. Keep each 2FA entry labelled clearly so you can tell the work verification from the personal one. If a result will not scan, raise the error correction level or enlarge the image.

Before you retire the old device, test the result: add the entry, wait for the next refresh, and compare the numbers on both screens. If they match for two refreshes in a row, the clocks agree and the setup is sound. If they drift, check the time setting on the phone first, since a few seconds of offset is the most common cause.

Scan a QR Code or Enter a Secret Key

Point the camera at the screen to scan the pattern. If that fails, copy the text and type it by hand: the manual route is the same app with the same key, only slower.

Moving Eleven Accounts to a New Phone with a 2FA Generator

Dana Okafor is replacing a cracked phone this weekend and has to decide: reset 2FA on eleven accounts one by one, or rebuild the entries from saved keys. The old phone still boots, so Dana opens the authenticator app and exports nothing. Instead, the keys saved in the password manager go into a two factor qr code generator.

Timeline of four TOTP verification codes generated 30 seconds apart from the same secret key
The same secret gives a new code every 30-second window.

First entry: a work portal. Dana types the 16-character key MFRGGZDFMZTWQ2LK, issuer Harbor Cloud, label [email protected], 6 digits and a 30-second period. Sixteen base32 characters carry 16 × 5 = 80 bits of secret, so a guess is hopeless. The QR appears, the new phone scans it, and the first code reads 482 917. The old phone shows the same number, which is the cross-check that matters.

Then the sensitivity rerun. A 6-digit code has 106 = 1,000,000 values, so one blind guess succeeds 0.0001% of the time; ten failed attempts total 0.001%. At 8 digits the single-guess odds fall to 0.000001%. Dana keeps 6 digits, since most apps cannot read the longer form anyway.

Here is the catch I would watch: the second entry, a bank, rejected every code. The generator was fine. The new phone's clock ran 47 seconds fast, more than one 30-second window, so each code was already stale. Switching the phone to automatic network time fixed it at once. A generator cannot see this, so when a perfect-looking entry fails, check the clock before you regenerate anything.

The rule Dana adopts: finish all eleven entries, confirm each with a fresh code, and only then wipe the old device. That order keeps a fallback alive until the last entry works, so a failed scan costs a minute and never a locked account.

TOTP vs HOTP: Choosing Two-Step Verification Codes

Two-step verification comes in two flavours. TOTP, covered above, depends on the clock. HOTP uses a count-based one-time password: each press on a token or app moves a counter forward, and the next code follows. Unlike a timed code, a counter code stays valid until it is used. TOTP is the more common pick for a phone app, while HOTP suits hardware tokens that have no clock. Most services that offer 2FA with an app use TOTP, so a generator that follows that standard covers nearly every 2FA login you will meet, and the verification step looks the same to you either way.

Keeping Your 2FA Secret Key Private

Treat the key like a second password. A browser-based generator is safest when the key never leaves your browser, so look for one that runs client-side and keeps things private. If you do not trust it, use an offline version or read the source code first, then turn off the network before pasting a real key.

Backup Habits for Your Authenticator Secrets

Store every key in a password manager as a backup, and never share a QR image in chat. Anyone holding it can make your codes, which defeats 2FA entirely. Check each entry once with a fresh verification code before you delete the old device, and keep a printed copy of recovery codes for every 2FA account in a safe place.

Frequently Asked Questions

Which apps can scan this QR code?
Any app that supports the otpauth:// URI scheme -- Google Authenticator, Authy, Microsoft Authenticator, 1Password, Bitwarden, andOTP, and most other TOTP/HOTP authenticator apps. This has been the de facto standard enrollment format since Google Authenticator's original implementation.
Is it safe to generate my 2FA QR code in a browser tool?
This tool builds the QR code entirely client-side -- your label, issuer, and secret never leave your device, and nothing is logged or transmitted. That said, treat the resulting QR code (and any screenshot of it) exactly like a password: anyone who scans it can generate valid codes for your account.
What if my secret isn't Base32?
Most services already give you a Base32 secret when they offer 'manual entry' as an alternative to their own QR code. If you only have a hex or raw-text key, convert it to Base32 first -- or use the TOTP Secret Generator to create a fresh, correctly-formatted one instead.
Can I regenerate the secret without retyping everything else?
Yes -- click the refresh icon inside the Secret field to fill it with a new random Base32 secret while keeping your label, issuer, and other settings exactly as they are.
Do I need to fill in the Advanced Options?
No. Algorithm (SHA1), digits (6), and period (30 seconds) are the universal defaults every authenticator app assumes. Only change them if a specific service's own setup instructions tell you to.

About the author

Vinitha Pu

Founder and designer

Vinitha Pu is a graphic designer based in Palakkad, Kerala, who builds free, privacy-friendly browser tools. She studied Textile and Apparel Design at Avinashilingam University and completed a C-Tech in Graphic Design at Image Creative Education in 2025. She designs, builds and maintains the password generators, strength checkers, hash tools and security calculators on PasswordHive.

  • Content author: Vinitha Pu
  • Fact checked by: Vinitha Pu. Each tool's output is checked against official test vectors or a reference implementation, and every strength and crack-time figure against the formula it uses, before it goes live.
  • Published Updated