Utils365

2FA code generator

See the 6-digit code for a secret key, right now and next, with a countdown.

  • 100% free
  • No sign-up
  • Runs in your browser

Made for developers and for testing sign-in flows. Keeping the secret keys of your real accounts in a web page defeats the point of a second factor: use an authenticator app on a separate device for those. Nothing you enter here is stored or sent.

Spaces and small letters are fine. You can also drop a picture of a setup QR code here.

Current code

Enter a secret key to see its code.

Codes are worked out from the time. If the clock is off by more than about half a minute, the codes will be wrong.

Set up an authenticator app

Make a new random secret, or show the key above as a QR code, and scan it with an authenticator app. With the default settings (SHA-1, 6 digits, 30 seconds) the app and this page then show the same codes; some apps ignore other settings in the code.

Next: QR code generator · Password generator · Base32 encode / decode

Report a problem with this tool

How to use 2FA code generator

  1. Enter the secret

    Paste a Base32 secret key, paste an otpauth:// setup link, or drop a picture of a setup QR code. Links and QR codes set the options too.

  2. Read the code

    The current code is shown with the seconds left before it changes and the code that comes next. Copy it with one click.

  3. Or make a new secret

    Generate a random 160-bit secret, add a service and account name, and scan the QR code with an authenticator app.

Why use Utils365

  • Follows the standard

    Codes follow RFC 6238 and are checked against its published test values for SHA-1, SHA-256 and SHA-512.

  • Reads setup links and QR codes

    Issuer, account, algorithm, code length and time step are all taken from an otpauth:// link or a picture of its QR code.

  • Built for testing

    Seeing the next code and the exact countdown makes it easy to test a sign-in flow you are building or debugging.

  • Nothing stored or sent

    The secret stays in the page’s memory. It isn’t saved, uploaded or put in the address, and it’s gone when you close the tab.

Frequently asked questions

Should I use this for my real accounts?

No. Two-step sign-in works because the second factor lives somewhere separate from your password. Pasting a real account’s secret into a web page on the same computer removes that separation. Use an authenticator app on your phone or a hardware key for real accounts, and this page for development and testing.

How is a TOTP code calculated?

The time in seconds since 1970 is divided by the time step, usually 30. That counter is signed with the secret using HMAC, 31 bits are picked out of the result, and the last 6 digits of that number are the code. Both sides do the same sum, so nothing is sent between them.

Why doesn’t my code match the one in my app?

Usually the clock: codes depend on the time, and a device that is more than about 30 seconds off gives wrong codes. The page shows the time it is using. Otherwise check the settings: a few services use SHA-256, SHA-512, 8 digits or a 60-second step, and all of them must match.

What is an otpauth:// link?

It is the text inside a 2FA setup QR code, such as otpauth://totp/Example:[email protected]?secret=JBSWY3DPEHPK3PXP&issuer=Example. It carries the secret and, optionally, the algorithm, the number of digits and the period.

What format is the secret key?

Base32: the letters A to Z and the digits 2 to 7, often shown in groups of four. Spaces, dashes and lower case are accepted here. New secrets made by this tool are 20 random bytes, which is 32 Base32 characters.

Does it support counter-based codes or app exports?

No. It makes time-based codes only, so otpauth://hotp links are refused, and so are the multi-account export QR codes some authenticator apps produce. Steam’s 5-character codes aren’t supported either.

Is my secret stored anywhere?

No. It is kept in memory while the page is open and is never written to storage, sent over the network or added to the address. Reloading the page clears it, so copy a new secret before you leave.