2FA code generator (TOTP)

Get the current two-factor code from a secret key, for example when setting up a new account or testing an authenticator.

← All tools
Works in your browser

Tool

What you get with the 2FA Code Generator

Standard TOTP codes

Implements the open standard (RFC 6238) used by Google Authenticator, Microsoft Authenticator and most websites.

Paste a key or a link

Enter the secret key, or paste a full otpauth:// link; the issuer and account name are read automatically.

Advanced settings

Supports 6, 7 or 8 digits, 30- or 60-second periods and SHA-1, SHA-256 or SHA-512.

Never saved

The key is used only inside the open page. It is not stored, uploaded or remembered after you close the tab.

Tested

Codes match the official RFC 6238 test values for all three algorithms.

How to use the 2FA Code Generator

  1. Paste the secret key (or the otpauth:// link) from the 2FA setup screen.
  2. Read the current 6-digit code; it changes every 30 seconds.
  3. Copy the code into the website asking for it.

Questions

Is it safe to paste my secret key here?

The key is processed only in this page and is never saved or uploaded; it is gone when you close the tab. Even so, a 2FA secret is as sensitive as a password: only do this on a device you trust, and use a proper authenticator app for everyday logins.

Why is my code rejected?

Codes depend on the exact time. Make sure your device clock is set automatically. Also check the key for typos, and the digits, period and algorithm if the service uses non-standard settings.

Does it work with Google Authenticator keys?

Yes. Google Authenticator, Microsoft Authenticator and most services use the standard TOTP method (RFC 6238) that this tool implements.

Install DocNova

The app is free, opens like a normal app, and works offline for tools you've used.