TOTP Generator
Enter a Base32 secret key to generate real-time TOTP codes — the same algorithm used by Google Authenticator, Authy, and all RFC 6238 authenticator apps. Shows a live countdown ring, the current 6-digit code, and a preview of the next code. Uses the Web Crypto API (crypto.subtle) — your secret never leaves your browser.
Frequently Asked Questions
What is TOTP and how does 2FA work?▼
TOTP (Time-based One-Time Password, RFC 6238) is the algorithm behind most 2FA/MFA apps including Google Authenticator, Authy, and Microsoft Authenticator. It works by combining a shared secret key with the current Unix timestamp (divided into 30-second windows) using HMAC-SHA1 to produce a 6-digit code. Because both your device and the server independently compute the code from the same secret and timestamp, they generate matching codes without any communication — making interception pointless since codes expire in 30 seconds.
Where do I find my TOTP secret key?▼
When enabling 2FA on a service, you're usually shown a QR code. Most services also offer a 'Can't scan? Enter manually' option that reveals the raw Base32 secret — a string of letters A-Z and digits 2-7, usually 16–32 characters (e.g., JBSWY3DPEHPK3PXP). Copy this and paste it here. You can also extract the secret from a QR code using a QR scanner app — the URL format is: otpauth://totp/Account?secret=YOURSECRET&issuer=Service
Is this compatible with Google Authenticator and Authy?▼
Yes. This tool implements the standard TOTP algorithm: RFC 6238, HMAC-SHA1, 6-digit output, 30-second time window. This is identical to Google Authenticator, Authy, Microsoft Authenticator, 1Password TOTP, Bitwarden Authenticator, and virtually all TOTP-compatible apps. If you enter the same secret, you'll get the same code as your authenticator app (within the same 30-second window).
Is my secret key sent to a server?▼
No. All computation happens entirely in your browser using the Web Crypto API (crypto.subtle.importKey and crypto.subtle.sign for HMAC-SHA1). Your secret key is never transmitted to any server or stored in any database. This tool also works offline once the page is loaded.
Why does the code change every 30 seconds?▼
The counter value fed to HMAC is floor(UnixTimestamp / 30) — it advances by 1 every 30 seconds. Each counter value produces a unique 6-digit code. The countdown timer shows how many seconds remain in the current 30-second window. The 'next code' preview shows the code for the upcoming window so you can avoid entering a code that will expire in 1-2 seconds.
What do I do if my TOTP codes don't match my authenticator app?▼
TOTP codes are time-sensitive — if your device clock is off by more than 30 seconds, codes will be wrong. (1) Sync your device clock with an NTP server. On Android: Settings → Date & Time → Sync. On iOS: Settings → General → Date & Time → Set Automatically. (2) Double-check that you're using the correct Base32 secret — even one wrong character produces completely different codes. (3) Make sure the service uses standard TOTP (30-second period, SHA1) — some use SHA256 or 60-second windows (uncommon).
Related Products
on GumroadDevToolkit Starter Kit
A ready-to-deploy developer tools website with 12 built-in tools. Astro + Preact + Tailwind. Deploy to Cloudflare Pages for free. Built-in SEO, dark mode, and ad-ready layout.
Buy on Gumroad →TypeScript Quick Reference Toolkit
5 practical reference files for TypeScript developers: cheatsheet, TS vs JS comparison, 20 utility types with real examples, tsconfig best practices template, and 15 common mistakes guide. Print it. Keep it on your desk.
Buy on Gumroad →Developer Productivity Bundle
Stop rebuilding the same setup every project. 51 VSCode snippets, 40 Git aliases, 5 Docker Compose stacks, 5 GitHub Actions workflows, 5 README templates, and a dotfiles kit. Set up a professional dev environment in under an hour.
Buy on Gumroad →You Might Also Need
TOTP Code Generator
Generate TOTP codes from a Base32 secret. RFC 6238 compliant. Compatible with Google Authenticator, Authy, and Microsoft Authenticator. Runs in browser.
Open free tool →
HTTP Security Headers Generator
Generate HTTP security headers configuration for nginx and Apache. Configure HSTS, CSP, X-Frame-Options, Referrer-Policy, and more with toggle switches. Copy ready-to-use configs.
Open free tool →
HTTP Security Headers Checker
Paste HTTP response headers and get a checklist of security headers present or missing. Checks CSP, HSTS, X-Frame-Options, and more.
Open free tool →
More Free Tools
Related Articles
Authentication Security Tools 2026: Modern Auth Patterns, MFA, Passwordless, and OAuth2
Complete guide to authentication security tools in 2026. Covers Auth0, Clerk, NextAuth.js v5, JWT security, Passkeys/WebAuthn, TOTP authenticator apps, OAuth2/OIDC, session management, and building secure auth systems with Node.js and Python.
JWT Token Decoder: How to Debug Authentication Issues
Learn how to use a JWT token decoder to diagnose 401 errors, expired tokens, missing claims, and auth misconfiguration. Practical debugging guide with code examples.
JWT Decoder Online — Inspect JSON Web Tokens Instantly
JWT decoder online — paste any token to see the header, payload, expiry time, and claims decoded in seconds. No library required. Learn how JWT works with code examples.
JWT Decoder Online: Inspect JSON Web Tokens Without a Library
Decode and inspect JWT tokens online for free. Learn JWT structure, how to read claims, verify signatures, and debug authentication issues in your apps.
JWT Tokens Explained: How to Decode and Debug Them
Understand JSON Web Tokens from header to signature. Learn how to decode JWTs, read their claims, debug authentication issues, and use free online JWT tools.
Enjoying this tool? Get more like it.
Weekly developer tool guides, productivity playbooks & AI tricks. Free. No spam.
Unlock AI-Powered Dev Tools
- ⚡ AI Code Review, Doc Generator & SQL Builder
- ⚡ All premium templates & early access
- ⚡ Member discounts on Gumroad products
$9/mo after trial · Cancel anytime
Want the full toolkit?
Get DevPlaybook Pro
Every template, guide, boilerplate, and automation script in one bundle. 13 premium products — grab them all at once and save big.
MIT licensed · Instant download · No subscription
See what's included → Browse all deals →