2FA secret key generator (TOTP)

A two-factor authentication seed, its QR code to scan and the current code, to check that your authenticator app saved it correctly.

Key (TOTP seed, Base32)

TOTP · SHA-1 · 6 digits · 30 seconds: the settings every app accepts.

Current code

Scan the QR code: your app should show the same code.

Send with onlyU — Your recipient gets a link they can open only once, then the link is gone. onlyU opens in a new tab with the secret already filled in: all you have to do is create the link. Free, no sign-up. How does it work?

otpauth:// URI

Computed in your browser. Nothing is sent unless you choose onlyU.

A 2FA secret, its QR code and the current code

Two-factor authentication with a 6-digit code relies on a seed, also called the TOTP secret: a secret shared between the service and the authenticator app. From this seed and the current time, both compute the same code every 30 seconds, using the TOTP algorithm defined in RFC 6238. The generator creates this seed in your browser and gives you everything you need to use it:

  • the seed: 20 random bytes (160 bits, the length recommended by RFC 4226), drawn by crypto.getRandomValues and written in Base32, that is 32 characters with no = padding;
  • the otpauth://totp/ URI, which combines the seed, the issuer, the account name and the calculation parameters;
  • the QR code of that URI, to scan with the app;
  • the current code, computed with the Web Crypto API, to check that the app has saved the seed correctly.

When to generate your own seed

Most online services create the seed themselves and show it as a QR code when you turn 2FA on. This generator is for when you are the one who has to provide it: a developer adding TOTP to an application who needs a test seed, an administrator provisioning an account on a system that accepts a supplied seed, a trainer showing how two-factor authentication works. For a team account whose service has already provided the seed, our guide explains how to share it.

The settings

The issuer and the account are the labels the app will display, for example “Example” and “alice@example.com”. They appear in the URI, which looks like this:

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

The calculation parameters are the ones every app understands: SHA-1, 6 digits, 30 seconds. The known weaknesses of SHA-1 concern collisions and do not affect HMAC-SHA-1, on which TOTP is built: it is the most compatible setting, without being a weak spot. Other values exist, but not every app supports them.

Check with the current code

Scan the QR code with the app, or enter the seed manually: every authenticator app allows it. Then compare the app's code with the one on the page. They must match. The page's code is computed from your computer's clock, the app's code from your phone's clock: if either device has the wrong time, the codes differ. Turn on automatic time setting, then compare again.

Share a seed the way you would share a password

Whoever holds the seed can generate codes at will, for as long as two-factor authentication stays set up with it. It is therefore an access credential, just like the account password, and should not sit in plain text in an email or a shared document.

“Send with onlyU” sends the seed, grouped in blocks of 4 characters, with its parameters (“TOTP, 6 digits, 30 s”), ready to be entered into an app. onlyU encrypts it in your browser and creates a link your recipient can open only once, valid for 24 hours, after which the link disappears. For an account used by several people, read our guide on how to share 2FA access to a shared account.

Frequently asked questions

What is a TOTP secret (seed)?

It is the secret shared between a service and your authenticator app. From this seed and the current time, the app computes a 6-digit code that changes every 30 seconds (RFC 6238).

Which apps accept this QR code?

Every TOTP-compatible app: Google Authenticator, Microsoft Authenticator, Authy, 1Password, Bitwarden, FreeOTP, Aegis… They also accept manual entry of the key.

Why show the current code?

To check that the app has saved the seed correctly: the code it displays must match the one on the page. If it doesn't, check your phone's clock.

Is the seed as sensitive as a password?

Yes: anyone who has it can generate codes at will. Share it like a password, through a link that opens only once, and don't keep it in plain text in a shared document.

How do I use it for a team account?

If the service lets you choose the seed, or gives you one, each team member saves it in their own app. Everyone then gets the same codes. Our guide walks you through the steps.