OTP code generator

Generate and validate time-based OTP (one time password) for multi-factor authentication.

About OTP code generator

Generates and checks time-based one-time passwords (TOTP, RFC 6238), the 6-digit codes that authenticator apps show for two-factor login. It shows the current code with the previous and next one, and gives you a key URI that can be turned into a QR code.

When you would use it

How to use it

  1. Use the generated secret or paste your own Base32 secret.
  2. Read the current 6-digit code; it changes every 30 seconds, and the previous and next codes are shown beside it.
  3. To enrol an app, use the key URI (otpauth://) or its QR code, then compare the app's code with the one shown here.

Things worth knowing

Frequently asked questions

Why is my code different from my phone app?
Either the secret differs, the app uses other settings (digits, algorithm or period), or a clock is off by more than about 30 seconds. Check the phone's time first, and make sure automatic time is on.
What is the difference between TOTP and HOTP?
HOTP uses a counter that increases with each use, while TOTP uses the current time divided into 30-second steps. TOTP is what authenticator apps use, and this tool is built around it.

All the tools