Free TOTP Code Generator (2FA One-Time Passwords)
Turn a Base32 secret or otpauth:// URI into live two-factor codes · the same math your authenticator app runs, right in your browser.
100% client-side · nothing you enter is ever sent to a server or stored.
Preview · sign in with a free account to run it
Enter a secret to see live codes · they refresh every 30 seconds.
How to use it
- Paste a Base32 secret, such as JBSWY3DPEHPK3PXP, or a full otpauth:// URI.
- Set the digits (6 or 8), period (30 or 60 seconds) and algorithm (SHA-1, SHA-256 or SHA-512) if the URI doesn't already set them.
- Read the current code and the countdown to the next one.
Example
Codes depend on the current time, so a live code will differ from this.
Input
otpauth://totp/Example:me@example.com?secret=JBSWY3DPEHPK3PXP&issuer=Example&digits=6&period=30
Result
Current code 492 039 next code in 17 s SHA-1 · 6 digits · 30 s
Why a code might not match
- Clock drift
- TOTP codes are derived from the current time. If your device clock is more than a few seconds off, codes won't match. Turn on automatic time.
- Wrong settings
- Most services use SHA-1, 6 digits and 30 seconds. If yours sets other values in the otpauth URI, use those.
- Base32 secret
- Letters A–Z and digits 2–7. Spaces and lowercase are usually tolerated; other characters mean the secret was copied wrongly.
Go deeper
Page updated
Frequently asked questions
Is it safe to paste a real 2FA secret?
Codes are computed entirely in your browser via Web Crypto · the secret is never sent to a server or stored. Still, it's best suited to testing your own TOTP implementation, debugging enrollment QR codes, or machines you trust · for live account secrets, prefer your authenticator app.
Why doesn't the code match my authenticator app?
Almost always clock drift or mismatched parameters. Both sides derive codes from the current time, so check your system clock first · then confirm digits (6 vs 8), period (30s vs 60s), and algorithm (SHA-1 is the default nearly everywhere) match the server's enrollment settings.
What's inside an otpauth:// URI?
It's what 2FA QR codes encode: otpauth://totp/Issuer:account?secret=BASE32&issuer=…&digits=6&period=30&algorithm=SHA1. Paste one here and the tool extracts the secret and parameters automatically.
Which apps and servers is this compatible with?
Google Authenticator, Authy, 1Password, Bitwarden, Apple Passwords, and virtually every 2FA server implement RFC 6238 · exactly what this generator implements, verified against the RFC's official test vectors.
Why would I need this?
To test the two-factor setup of an app you build, or to check a secret before you enrol it in an authenticator app.
Is pasting a real 2FA secret risky?
The code is computed in your browser and the secret isn't sent anywhere. But a 2FA secret is as sensitive as a password, so use test secrets where you can.
Want the full picture?
This tool covers one narrow check. A full SimplyScan runs 60 checks across 14 categories · exposed keys, RLS, XSS, auth, and speed · in 30 seconds.
Run a full security scanRelated tools
JWT Generator
Build a signed HS256 JSON Web Token for testing · edit the payload, set a secret, and copy the token. Everything runs locally via Web Crypto.
HMAC Generator
Compute an HMAC signature from a message and secret key · SHA-256/384/512, hex or Base64 output, all in your browser via Web Crypto.
PKCE Generator
Generate a spec-compliant PKCE pair · a random code_verifier and its SHA-256 code_challenge · for testing OAuth 2.0 authorization-code flows.