Skip to main content

TOTP / 2FA Code Generator

New

Enter a Base32 secret to see the current and next TOTP code, refreshed live.

totp2faauthenticatorsecurity
Read the guide
Shortcuts:⌘ KSearch

Generate live TOTP codes for testing

Enter a Base32 secret key (the same one shown when you scan a 2FA QR code) to see the current 6-digit code and the next one, refreshed every second. Useful for testing 2FA flows without your phone.

Everything runs locally with the Web Crypto API. Your secret is never sent anywhere — it only lives in this page's memory while it's open.

Continue with:

Frequently Asked Questions

Is this the same algorithm my phone's authenticator app uses?

Yes, for standard setups. It implements RFC 6238 TOTP on top of RFC 4226 HOTP using the Web Crypto API's HMAC-SHA1/SHA-256, which is what most authenticator apps use by default with a 30-second period and 6 digits.

Does it work with secrets that have spaces or lowercase letters?

Yes. The Base32 decoder strips anything that is not A-Z or 2-7 and uppercases the input first, so secrets copied with spacing (as some services display them) still decode correctly.

Where does the time come from?

It uses your device's system clock (Date.now()). If your device clock is significantly off from real time, the generated codes will not match a server checking against accurate time.

Is my secret sent anywhere?

No. The secret is decoded and used only in-memory via the Web Crypto API in your browser; it is never transmitted or stored.

Can I change the code length or time period?

Yes. Digits (6 or 8), period in seconds, and algorithm (SHA-1 or SHA-256) are all adjustable, matching the less common TOTP configurations some services use.

Related Tools