EN
PortuguêsEnglishEspañol
All tools
Developer tools 100% free

TOTP code generator (2FA)

Generate and check two-factor authentication codes (TOTP, RFC 6238) from a Base32 secret key, create new keys and the otpauth:// link to test logins with 2FA.

How to use

Thank you so much for helping!

Every donation helps pay for the servers and keeps the tools free for everyone. Pick or type an amount:

Secure payment by Stripe. Opens in a new tab.

Back to Encoding, hashes and networks

Two-factor TOTP codes

The key never leaves your browser. Use test keys: the secret key gives access to the account’s second factor.

Available in: PortuguêsEspañolEnglish

Advertisement

TOTP code generator (2FA): what it is for

Paste the Base32 secret key and see the current, previous and next TOTP codes, with the period countdown. Choose the algorithm (SHA-1, SHA-256 or SHA-512), 6 or 8 digits and a 30 or 60 second period, according to RFC 6238. The tool also generates new random keys and builds the otpauth:// link used in authenticator app QR codes.

The key never leaves your browser. Use test keys only: the secret key gives access to the account's second factor.

How to use

  1. Paste the Base32 key or generate a new one.
  2. Adjust algorithm, digits and period.
  3. See the current code and copy the otpauth link.

When to use it

  • Testing a system's 2FA implementation.
  • Checking whether the server and authenticator are in sync.
  • Generating keys for development environments.

Frequently asked questions

What is TOTP?

It's the time-based one-time password algorithm, defined in RFC 6238, used by authenticator apps. It computes an HMAC of the secret key with the number of 30-second periods since 1970 and turns the result into a 6-digit code.

Can I use it instead of an authenticator app?

It's not recommended. This tool is for developers testing a 2FA implementation and for checking whether a key produces the right codes. The secret key gives full access to the account's second factor, so keep real keys only in your authenticator app.

Why doesn't the code match the server's?

Check that the device's clock is right, that the algorithm (SHA-1 is the default), number of digits and period match the server settings, and that the key was copied in full, with no missing characters.

Is it really free?

Yes, 100% free. No sign-up, no subscription and no usage limits. All Tools123 tools are free and run right in your browser.

Similar tools

The tools are provided as is, without warranty. We are not responsible for the results or for how they are used.