2FA Code Generator (TOTP)

Type or paste a two-factor secret key, or a whole otpauth:// link, and see the same 6-digit code an authenticator app would show, with a countdown to the next one. You can also check whether a code is valid right now, or set up 2FA for your own app: make a new secret and a QR code that Google Authenticator, Microsoft Authenticator, Authy and similar apps can scan. Codes follow RFC 6238 and are made in your browser; the secret is not saved or sent.

Mode

The secret is the text shown under the QR code when you turn on two-step verification (often labelled 'Can't scan the code?').

Anyone who has a secret key can make its codes. This page does not save the secret, but avoid pasting the secret of a real account on a shared or office computer, and never send it to anyone who asks for it.

Code generation runs in your browser. What you type never leaves this device.

Features

  • Live codes from a Base32 secret, with a countdown and the next code

  • Reads otpauth://totp/ links, including issuer, account, digits, period and algorithm

  • 6 or 8 digits, 30 or 60 seconds, SHA1, SHA256 or SHA512

  • Check a code against the current, previous and next time step

  • Set up mode: a new random 160-bit secret, otpauth link and QR code for authenticator apps

  • Tested against the official RFC 6238 and RFC 4226 test values

  • Runs in your browser: the secret never leaves this page and is not stored

Who uses it

Developers adding 2FA

Make a test secret and QR code, scan it with your phone, and compare codes while you build login with two-step verification.

Testing and QA

Generate codes for test accounts in staging without passing a phone around the team.

Checking a clock or setup problem

When an app keeps rejecting codes, compare what this page shows with your authenticator to see whether the secret, settings or the device clock is wrong.

Moving to a new phone

If you saved the secret key when you enabled 2FA, check it still produces the right codes before adding it to a new authenticator app.

How TOTP codes work

The secret and the clock

When you turn on two-step verification, the service gives your authenticator app a secret key, usually inside a QR code. Every 30 seconds the app combines the secret with the current time using HMAC and shows 6 digits. The server does the same and compares. No internet is needed on the phone, only a correct clock.

The secret is written in Base32 (letters A to Z and digits 2 to 7), often in groups of four. Spaces and lowercase are fine here.

Keep the secret private

  • Anyone with the secret can make your codes forever, so treat it like a password.
  • Don't paste the secret of a real bank, email or work account into any website on a shared or office computer. This page doesn't save or send it, but the screen and clipboard can still be seen.
  • Use this page for your own apps, test accounts, and checking secrets you already keep safely.

Codes rejected?

  • Check the device's time is set automatically. A clock 30 seconds off gives the wrong code.
  • Check the settings: most services use 6 digits, 30 seconds and SHA1. Some apps ignore other settings.
  • Servers usually accept the code just before and after the current one; the checker here does the same.

OTP by voice and SMS

Authenticator codes need an app. For customers who prefer a call, a voice OTP reads the code aloud on any phone, which you can add as a fallback to your login.

2FA Code Generator (TOTP) - FAQ