TOTP Secret Key Generator

Generate a random base32 secret key for setting up a TOTP two-factor authentication app. The key is created in your browser and is not sent anywhere.

1 Pick your options

2 Your answer

Press Generate and your answer shows here.

How to use the TOTP Secret Key Generator

  1. Set the secret length. 26 or more characters gives at least 128 bits of entropy.
  2. Choose plain or grouped format for easier reading.
  3. Click Generate and copy the key into your authenticator app or server settings.

Frequently asked questions

What is a TOTP secret key?

It is a shared random value, encoded in base32 (letters A to Z and digits 2 to 7), that a server and an authenticator app both hold. The app combines it with the current time to produce a 6-digit code every 30 seconds.

How long should a TOTP secret be?

RFC 4226 recommends a secret of at least 128 bits. In base32, each character carries 5 bits, so 26 characters is the minimum and 32 characters (160 bits) is a common choice.

Is it safe to generate a secret in the browser?

This tool uses the browser's crypto.getRandomValues function and does not send the key over the network. For production systems, generate and store secrets on the server that needs them.

Wrote something with AI? Slop Monkey rewrites it so it sounds like you, and keeps your facts.