TOTP Code Generator
Enter a Base32 secret key and generate real-time TOTP codes — exactly like Google Authenticator. Shows a live countdown timer, 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 it work?▼
TOTP (Time-based One-Time Password) is defined in RFC 6238. It combines a shared secret key with the current Unix timestamp (divided into 30-second windows) and runs them through HMAC-SHA1 to produce a 6-digit code. Because both your app and the server share the same secret and use the same clock, they independently generate the same code at the same time.
What is a Base32 secret key?▼
When you set up 2FA in an app, the service gives you a secret key encoded in Base32 — the letters A-Z plus digits 2-7. This key is usually shown as a QR code, but most services also show the raw text version for manual entry. It looks like JBSWY3DPEHPK3PXP.
Is this compatible with Google Authenticator?▼
Yes. This tool implements the same TOTP algorithm (RFC 6238, HMAC-SHA1, 6 digits, 30-second period) that Google Authenticator, Authy, Microsoft Authenticator, and 1Password TOTP use.
Is my secret key sent anywhere?▼
No. All computation happens in your browser using the Web Crypto API (crypto.subtle). Your secret key is never transmitted to any server.
Why does the code change every 30 seconds?▼
The code is derived from the current time window (floor(Unix time / 30)). Every 30 seconds, the window advances and a new counter value produces a new code. This time-bound nature means stolen codes become useless almost immediately.
What does the countdown timer show?▼
The ring shows how many seconds are left in the current 30-second window. When it reaches 0, the code regenerates automatically. The 'Next code' preview shows what the next code will be so you can avoid entering a code that will expire in 1-2 seconds.
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
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 →
Content Security Policy Builder
Visual CSP builder with all directives. Generate Content-Security-Policy headers with source expressions, nonces, and report endpoints.
Open free tool →
More Free Tools
Related Articles
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.
Best Free JWT Decoder Tools in 2026
Compare the best free JWT decoder tools available in 2026. Decode, inspect, and debug JSON Web Tokens without leaving your browser—no installation required.
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 →