Skip to main content
{/}codefunc
Encoders & CryptoRuns locally

TOTP / 2FA Code Generator

Generate time-based one-time passwords (TOTP) from a Base32 secret.

About this tool

Generate time-based one-time passwords from a Base32 secret for local 2FA testing (RFC 6238).

Use test secrets only. Pair with Base32 encode/decode when a secret is pasted in the wrong alphabet. See the TOTP / 2FA guide on the blog for clock skew and window size.

Secrets stay on your device during generation.

How to use

  1. Enter a Base32 secret in the Base32 secret field (use a test secret, never a live 2FA seed).
  2. Optionally set Algorithm (SHA-1 / SHA-256 / SHA-512), Digits, and Period (s).
  3. Click Generate to compute the current code locally.
  4. Copy the code from the output; regenerate as the period expires.

Example

RFC 6238-style test secret (dev only)

Input

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

Output

Code:       123456
Valid for:  18s
Next code:  789012

Codes rotate with the clock — your numbers will differ; the layout matches the tool output.

Limitations

  • For test and development secrets only — do not paste production authenticator seeds into any website.
  • Clock skew on your machine will desync codes from the server under test.
  • Does not scan QR URIs or manage account enrollment; paste the raw Base32 secret yourself.

Related guides

1

Related tools

3

Frequently asked questions

What does the TOTP / 2FA Code Generator do?

Generate time-based one-time passwords (TOTP) from a Base32 secret. Runs in your browser — no install, no account.

How do I use the TOTP / 2FA Code Generator?

Enter a Base32 secret in the Base32 secret field (use a test secret, never a live 2FA seed). Optionally set Algorithm (SHA-1 / SHA-256 / SHA-512), Digits, and Period (s). Click Generate to compute the current code locally. Copy the code from the output; regenerate as the period expires.

Is the TOTP / 2FA Code Generator free?

Yes. No signup, no usage limits, no paywall.

Does the TOTP / 2FA Code Generator upload my data?

No. Processing happens locally in JavaScript. Your input is not uploaded, stored, or logged.

What are the limitations of the TOTP / 2FA Code Generator?

For test and development secrets only — do not paste production authenticator seeds into any website. Clock skew on your machine will desync codes from the server under test. Does not scan QR URIs or manage account enrollment; paste the raw Base32 secret yourself.

Search tools

Find a developer tool