2FA Code Generator

Enter a Base32 secret, paste an otpauth link, or open a secret from the URL to generate rotating TOTP codes entirely inside your browser.

Base32, otpauth links, #secret fragments, and /SECRET links are accepted automatically.

A fresh code appears every 30 seconds

Quick-switch slots

Saved in this browser — your slots survive a refresh.

No quick-switch slots yet.
About this service
This page calculates RFC 6238 six-digit TOTP codes using SHA-1 and a 30-second window. The secret and generated codes stay in this tab; nothing is submitted to a server.
Safe URL format
Load a secret with /YOUR_BASE32_SECRET or #secret=YOUR_BASE32_SECRET. The fragment form keeps the secret out of requests to the host, so it is not written to server access logs.
Public API
No remote API is required. URL input works as the public interface, while code generation runs locally in your browser with an embedded TOTP implementation.

Frequently asked questions

What is a 2FA code generator?

A 2FA code generator creates time-based one-time passwords (TOTP) — the 6-digit codes used for two-factor authentication. otpkey.xyz generates these codes directly in your browser from your secret key, with a new code every 30 seconds, exactly like Google Authenticator or Authy.

Is it safe to use this online TOTP generator?

Yes. All code generation happens locally in your browser using JavaScript — your secret key is never sent to any server, never stored in a database, and never logged. For maximum privacy, use the #secret= URL format, which keeps your secret out of server access logs entirely.

How do I use my authenticator secret here?

Paste your Base32 secret into the input box, paste an otpauth:// link, or open a share link like otpkey.xyz/YOUR_SECRET. Your 6-digit code appears instantly with a countdown showing when the next code arrives.

Can I save multiple 2FA secrets?

Yes. Use "Add current secret" to save quick-switch slots in your browser, then jump between accounts with one click. Slots are stored only in your own browser's local storage — they never leave your device.

Do I need to install an app or sign up?

No. otpkey.xyz is a free online 2FA code generator with no signup, no app install, and no account. It works on desktop and mobile browsers, even offline after the page loads.

Your secret is processed locally and is never uploaded.

Copied