TOTP Code Generator
Generate time-based one-time passwords from a TOTP secret key. Enter your base32 secret, choose a period and digit length, and get the current and next codes with a live countdown timer. Useful for testing and debugging 2FA integrations.
How to Use TOTP Code Generator
How to Use the TOTP Code Generator
Step 1: Enter Your Secret
Paste your base32-encoded TOTP secret into the Secret Key field. This is the secret shown during 2FA setup — usually displayed as a QR code with a text fallback like JBSWY3DPEHPK3PXP.
Base32 uses only the characters A–Z and the digits 2–7. Spaces and padding characters (=) are ignored automatically.
Step 2: Match Your App Settings
Set the Time Period and Code Length to match what your service configured:
| Setting | Default | Notes |
|---|---|---|
| Period | 30 seconds | Most services — Google, GitHub, AWS, etc. |
| Period | 60 seconds | Some enterprise or legacy systems |
| Digits | 6 | Standard for most authenticator apps |
| Digits | 8 | Higher-security implementations |
When in doubt, use 30 seconds and 6 digits — these are the RFC 6238 defaults.
Step 3: Read the Live Codes
- Current Code — The active TOTP code right now. Copy and use it immediately.
- Countdown ring — Shows how many seconds remain before the code rotates. Green = plenty of time, amber = 10s left, red = 5s or less.
- Next Code — The code that will activate next. Highlighted when fewer than 5 seconds remain so you know what to expect.
Common Uses
- Testing 2FA login flows — Verify that your server correctly validates TOTP codes during integration testing.
- Debugging clock drift — If a code is rejected, compare the generated code with your authenticator app. Mismatches indicate a time sync issue on the server.
- Recovering a 2FA secret — If you have the original base32 secret but lost access to your authenticator app, paste it here to generate valid codes.
- Verifying TOTP library output — Cross-check codes generated by your backend TOTP library against this tool to confirm correctness.
Frequently Asked Questions
Most Viewed Tools
Password Entropy Calculator
Calculate the information-theoretic bit entropy of any password or API key. Detects character set pools automatically, shows the total number of possible combinations, and estimates crack time across five attack scenarios from rate-limited web logins to GPU cracking clusters.
Use Tool →Content Security Policy Generator
Build Content Security Policy headers interactively. Toggle directives like script-src, style-src, and img-src, select allowed source tokens, and add custom origins. Instantly outputs your CSP as an HTTP header, meta tag, Nginx directive, or Apache header.
Use Tool →Screen Size Converter
Calculate screen width and height from diagonal size and aspect ratio. Convert between inches and centimeters for displays, TVs, and monitors with instant dimension calculations.
Use Tool →SSH Key Generator
Generate Ed25519 and RSA 4096-bit SSH key pairs entirely in your browser. Keys are never sent to any server — 100% client-side using the Web Crypto API.
Use Tool →PGP Key Generator
Generate PGP public and private key pairs for email encryption and code signing. Supports ECC (Curve25519) and RSA up to 4096-bit. Entirely browser-side — keys never leave your device.
Use Tool →DPI Calculator
Calculate DPI (dots per inch), image dimensions, and print sizes. Convert between pixels and physical dimensions for printing and displays.
Use Tool →Paper Size Converter
Convert between international paper sizes (A4, Letter, Legal) with dimensions in mm, cm, and inches. Compare ISO A/B series and North American paper standards.
Use Tool →Reorder PDF Pages
Drag and drop to rearrange PDF pages in any order. Upload your PDF, preview all pages as thumbnails, drag pages to reorder them, and download the rearranged PDF. Fast, visual, and privacy-focused.
Use Tool →Related Privacy & Security Tools
PGP Key Generator
Generate PGP public and private key pairs for email encryption and code signing. Supports ECC (Curve25519) and RSA up to 4096-bit. Entirely browser-side — keys never leave your device.
Use Tool →Password Entropy Calculator
Calculate the information-theoretic bit entropy of any password or API key. Detects character set pools automatically, shows the total number of possible combinations, and estimates crack time across five attack scenarios from rate-limited web logins to GPU cracking clusters.
Use Tool →Content Security Policy Generator
Build Content Security Policy headers interactively. Toggle directives like script-src, style-src, and img-src, select allowed source tokens, and add custom origins. Instantly outputs your CSP as an HTTP header, meta tag, Nginx directive, or Apache header.
Use Tool →SSH Key Generator
Generate Ed25519 and RSA 4096-bit SSH key pairs entirely in your browser. Keys are never sent to any server — 100% client-side using the Web Crypto API.
Use Tool →API Key Generator
Generate secure, cryptographically random API keys for authentication and authorization. Create custom API keys with various formats including hex, base64, and prefixed keys.
Use Tool →RSA Key Generator
Generate secure RSA public/private key pairs for encryption, digital signatures, and authentication. Create 1024 to 4096-bit RSA keys instantly in your browser.
Use Tool →PIN Generator
Generate secure numeric PINs for devices, accounts, and security systems. Create random PINs with strength analysis and security recommendations.
Use Tool →Webhook Signature Verifier
Compute and verify HMAC webhook signatures in your browser. Supports HMAC-SHA256, SHA-512, and SHA-1 with hex or base64 encoding. Compatible with Stripe, GitHub, Twilio, and any HMAC-signed webhook.
Use Tool →Share Your Feedback
Help us improve this tool by sharing your experience