TOTP / 2FA Generator

Generate time-based one-time passwords (2FA codes) from a base32 secret.

TOTP codes are computed locally in your browser with the Web Crypto API and nothing is uploaded, but avoid pasting real production 2FA secrets into any web tool.

Need to inspect an auth token? Try the JWT Decoder.

About TOTP / 2FA Generator

This TOTP generator turns a base32 secret into the same time-based one-time password your authenticator app would show, refreshing automatically every second. Paste the secret from a 2FA setup screen and instantly get a live OTP, with a countdown bar showing how long the current code stays valid. As a flexible 2fa code generator it supports SHA-1, SHA-256, and SHA-512, 6 or 8 digit codes, and custom periods, so you can match almost any service or test your own MFA implementation. It's built for developers, QA engineers, and DevOps testing two-factor login flows, debugging authenticator code generation, or verifying a server's TOTP output. Everything is computed locally in your browser with the Web Crypto API, so your data never leaves your device and there's no tracking.

Features

How to use the TOTP / 2FA Generator

  1. Paste your base32 secret into the secret field.
  2. Pick the digit count, hash algorithm, and period to match your service.
  3. Read the current TOTP code shown in large digits as it refreshes.
  4. Click the copy button to grab the code before the countdown expires.

Example

Input

Secret: JBSWY3DPEHPK3PXP
Digits: 6, Algorithm: SHA-1, Period: 30s

Output

Code: 282 760 (example for one 30s window; changes each period)

A 6-digit SHA-1 TOTP derived from a base32 secret. The actual digits depend on the current time window.

Common errors & troubleshooting

Frequently asked questions

What is a TOTP generator?
A TOTP generator computes time-based one-time passwords from a shared base32 secret, producing the same rotating 2FA codes an authenticator app shows. This ArrayKit TOTP generator computes them live in your browser.
How do I generate a 2FA code with this TOTP generator?
Paste the base32 shared secret from your service's 2FA setup screen, set the digits, algorithm, and period to match, then read the live code. It updates every second with a countdown bar.
What secret format does the TOTP generator accept?
It accepts the base32 shared secret (letters A-Z and digits 2-7) from a service's 2FA setup screen. Spaces and padding are ignored automatically; otpauth:// URIs are not used here.
Which algorithms and digit lengths are supported?
You can choose SHA-1, SHA-256, or SHA-512, 6 or 8 digit codes, and a custom period from 5 to 120 seconds, matching almost any TOTP service.
Why does my code differ from my authenticator app?
Usually a mismatch in algorithm, digit count, period, or device clock. Align those settings and ensure your system time is accurate, since codes are tied to the current time window.
Is my TOTP secret kept private?
Yes. The TOTP generator computes codes locally with the Web Crypto API, so your secret never leaves your device and nothing is uploaded to a server. Avoid pasting real production secrets here.

Related tools

All ArrayKit tools